Преглед на файлове

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: