Skip to contentSkip to conversation

ui/cocoa.m: eliminate normalWindow warning

PATCH Applied Programmingkid 2 participants 2 messages Sep 25, 2015 – Oct 13, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ui/cocoa.m: eliminate normalWindow warning

Eliminate this warning associated with the setting of the normalWindow's title:

ui/cocoa.m: In function '-[QemuCocoaAppController init]':
ui/cocoa.m:888:9: warning: format not a string literal and no format arguments
[-Wformat-security]

         [normalWindow setTitle:[NSString stringWithFormat:@"QEMU"]];
---
 ui/cocoa.m |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
ui/cocoa.m +1 -1
index 334e6f6..fa21fdb 100644
@@ -855,7 +855,7 @@ QemuCocoaView *cocoaView;
             exit(1);
         }
         [normalWindow setAcceptsMouseMovedEvents:YES];
-        [normalWindow setTitle:[NSString stringWithFormat:@"QEMU"]];
+        [normalWindow setTitle:@"QEMU"];
         [normalWindow setContentView:cocoaView];
 #if (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_10)
         [normalWindow useOptimizedDrawing:YES];
Signature · 1 line
1.7.5.4
#1 lore raw
Quoted 28 lines · Programmingkid

Eliminate this warning associated with the setting of the normalWindow's title:

ui/cocoa.m: In function '-[QemuCocoaAppController init]':
ui/cocoa.m:888:9: warning: format not a string literal and no format arguments
[-Wformat-security]

         [normalWindow setTitle:[NSString stringWithFormat:@"QEMU"]];
---
 ui/cocoa.m |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
ui/cocoa.m +1 -2
index 334e6f6..fa21fdb 100644
@@ -855,7 +855,7 @@ QemuCocoaView *cocoaView;
             exit(1);
         }
         [normalWindow setAcceptsMouseMovedEvents:YES];
-        [normalWindow setTitle:[NSString stringWithFormat:@"QEMU"]];
+        [normalWindow setTitle:@"QEMU"];
         [normalWindow setContentView:cocoaView];
 #if (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_10)
         [normalWindow useOptimizedDrawing:YES];
--
Quoted 1 line

1.7.5.4

Thanks, applied to cocoa.next (sorry it's taken me a while to get back to these).

-- PMM