Explorar o código

add comment for use of strdup

Jonas Reinsch %!s(int64=7) %!d(string=hai) anos
pai
achega
1b80372736
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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: