From 23b22793553cf44ebd1fb73a3c533e759dff4e2c Mon Sep 17 00:00:00 2001 From: Sergei Dyshel Date: Wed, 15 May 2024 17:28:41 +0300 Subject: [PATCH] Fix call to NSLog when logging Calling `NSLog(message!)` will interpret message as format string (see [docs](https://developer.apple.com/documentation/foundation/1395275-nslog), causing errors and even segfault in some edge cases. Instead, use proper format string and message as argument. Fixes https://github.com/johnste/finicky/issues/328. --- Finicky/Finicky/API.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Finicky/Finicky/API.swift b/Finicky/Finicky/API.swift index e891250..057d93a 100644 --- a/Finicky/Finicky/API.swift +++ b/Finicky/Finicky/API.swift @@ -20,7 +20,7 @@ import JavaScriptCore static func log(_ message: String?) { if message != nil { - NSLog(message!) + NSLog("%@", message!) logToConsole?(message!, false) } }