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 190b8a7 commit f49f6a9Copy full SHA for f49f6a9
stdlib/public/core/StringGuts.swift
@@ -325,7 +325,7 @@ func _persistCString(_ p: UnsafePointer<CChar>?) -> [CChar]? {
325
guard let s = p else { return nil }
326
let bytesToCopy = UTF8._nullCodeUnitOffset(in: s) + 1 // +1 for the terminating NUL
327
let result = [CChar](unsafeUninitializedCapacity: bytesToCopy) { buf, initedCount in
328
- buf.baseAddress!.assign(from: cString, count: bytesToCopy)
+ buf.baseAddress!.assign(from: s, count: bytesToCopy)
329
initedCount = bytesToCopy
330
}
331
return result
0 commit comments