diff --git a/Sources/SwiftMetrics/SwiftMetrics.swift b/Sources/SwiftMetrics/SwiftMetrics.swift index 764a0cc..68259fc 100644 --- a/Sources/SwiftMetrics/SwiftMetrics.swift +++ b/Sources/SwiftMetrics/SwiftMetrics.swift @@ -66,7 +66,10 @@ private func receiveAgentCoreData(cSourceId: UnsafePointer, cSize: CUnsig } let source = String(cString: cSourceId) if source != "api" { - let message = String(bytesNoCopy: data, length: size, encoding: String.Encoding.utf8, freeWhenDone: false) ?? "" + let opaquePointer = OpaquePointer(data) + let cstrPointer = UnsafePointer(opaquePointer) + + let message = String(cString:cstrPointer) ?? "" if swiftMon != nil { swiftMon!.raiseCoreEvent(topic: source, message: message) }