summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston Sequoia <jeremyhu@apple.com>2015-06-09 23:41:12 -0700
committerJeremy Huddleston Sequoia <jeremyhu@apple.com>2015-10-13 13:50:09 -0700
commit5788401a9acba603d86161e716cc3e1f83ac8e44 (patch)
tree6ea1c0449124281c4443e4a5167d083d7f6d8ddf
parente39ffe687bd12fb8ff278073060f7d48769bccc0 (diff)
XQuartz: Silence -Wformat-security for NSRunAlertPanel
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com> (cherry picked from commit 9003a3e5c55903ce4e371b2d5cb5030b5f97ae0e)
-rw-r--r--hw/xquartz/X11Application.m15
-rw-r--r--hw/xquartz/X11Controller.m6
2 files changed, 10 insertions, 11 deletions
diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 2efbd658b..8a928baac 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -1069,12 +1069,12 @@ X11ApplicationCanEnterRandR(void)
if (!XQuartzIsRootless)
QuartzShowFullscreen(FALSE);
- switch (NSRunAlertPanel(title, msg,
+ switch (NSRunAlertPanel(title, @"%@",
NSLocalizedString(@"Allow",
@""),
NSLocalizedString(@"Cancel",
@""),
- NSLocalizedString(@"Always Allow", @""))) {
+ NSLocalizedString(@"Always Allow", @""), msg)) {
case NSAlertOtherReturn:
[X11App prefs_set_boolean:@PREFS_NO_RANDR_ALERT value:YES];
[X11App prefs_synchronize];
@@ -1122,10 +1122,10 @@ X11ApplicationFatalError(const char *f, va_list args)
*/
dispatch_sync(dispatch_get_main_queue(), ^{
if (NSAlertDefaultReturn ==
- NSRunAlertPanel (title, msg,
+ NSRunAlertPanel (title, @"%@",
NSLocalizedString (@"Quit", @""),
- NSLocalizedString (
- @"Report...", @""), nil)) {
+ NSLocalizedString (@"Report...", @""),
+ nil, msg)) {
exit (EXIT_FAILURE);
}
});
@@ -1160,9 +1160,8 @@ check_xinitrc(void)
@"Startup xinitrc dialog");
if (NSAlertDefaultReturn ==
- NSRunAlertPanel(nil, msg, NSLocalizedString(@"Yes", @""),
- NSLocalizedString(@"No",
- @""), nil)) {
+ NSRunAlertPanel(nil, @"%@", NSLocalizedString(@"Yes", @""),
+ NSLocalizedString(@"No", @""), nil, msg)) {
char buf2[1024];
int i = -1;
diff --git a/hw/xquartz/X11Controller.m b/hw/xquartz/X11Controller.m
index a5c513861..c75493c42 100644
--- a/hw/xquartz/X11Controller.m
+++ b/hw/xquartz/X11Controller.m
@@ -929,9 +929,9 @@ extern char *bundle_id_prefix;
* and then run the alert on a timer? It seems to work here, so..
*/
- return (NSRunAlertPanel(title, msg, NSLocalizedString(@"Quit", @""),
- NSLocalizedString(@"Cancel", @""), nil)
- == NSAlertDefaultReturn) ? NSTerminateNow : NSTerminateCancel;
+ NSInteger result = NSRunAlertPanel(title, @"%@", NSLocalizedString(@"Quit", @""),
+ NSLocalizedString(@"Cancel", @""), nil, msg);
+ return (result == NSAlertDefaultReturn) ? NSTerminateNow : NSTerminateCancel;
}
- (void) applicationWillTerminate:(NSNotification *)aNotification _X_NORETURN