소스 검색

add comment for use of strdup

Jonas Reinsch 7 년 전
부모
커밋
1b80372736
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      deltachat-ios/AppDelegate.swift

+ 1 - 1
deltachat-ios/AppDelegate.swift

@@ -22,10 +22,10 @@ public func callbackSwift(event: CInt, data1: CUnsignedLong, data2: CUnsignedLon
         guard let url = URL(string: urlString) else {
             return nil
         }
-        // FIXME: synchronous call ok here?
         guard let configText = try? String(contentsOf: url) else {
             return nil
         }
+        // see the strdup tip here: https://oleb.net/blog/2016/10/swift-array-of-c-strings/#alternative-strdup-and-free
         let p = UnsafePointer(strdup(configText))
         return p
     case DC_EVENT_INFO: