We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d50ea6b commit 3428368Copy full SHA for 3428368
stdlib/public/Darwin/Foundation/NSStringAPI.swift
@@ -75,7 +75,7 @@ internal func _persistCString(_ p: UnsafePointer<CChar>?) -> [CChar]? {
75
}
76
let bytesToCopy = UTF8._nullCodeUnitOffset(in: cString) + 1 // +1 for the terminating NUL
77
let result = [CChar](unsafeUninitializedCapacity: bytesToCopy) { buffer, initializedCount in
78
- buffer.baseAddress!.assign(from: cString, count: bytesToCopy)
+ buffer.baseAddress!.initialize(from: cString, count: bytesToCopy)
79
initializedCount = bytesToCopy
80
81
return result
0 commit comments