From dbd5ea1ff08ec96e2609151a88a702197dff40b7 Mon Sep 17 00:00:00 2001 From: Roopesh Chander Date: Fri, 22 Mar 2019 15:31:02 +0530 Subject: [PATCH] macOS: Syntax highlighter: Swift can bridge c strings automatically Signed-off-by: Roopesh Chander --- WireGuard/WireGuard/UI/macOS/View/ConfTextStorage.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WireGuard/WireGuard/UI/macOS/View/ConfTextStorage.swift b/WireGuard/WireGuard/UI/macOS/View/ConfTextStorage.swift index 077ee1e..2219759 100644 --- a/WireGuard/WireGuard/UI/macOS/View/ConfTextStorage.swift +++ b/WireGuard/WireGuard/UI/macOS/View/ConfTextStorage.swift @@ -143,7 +143,7 @@ class ConfTextStorage: NSTextStorage { .font: defaultFont ] backingStore.setAttributes(defaultAttributes, range: fullTextRange) - var spans = highlight_config(backingStore.string.cString(using: String.Encoding.utf8))! + var spans = highlight_config(backingStore.string)! evaluateExcludePrivateIPs(highlightSpans: spans) while spans.pointee.type != HighlightEnd {