XQuartz: Silence -Wformat-security for NSRunAlertPanel

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
This commit is contained in:
Jeremy Huddleston Sequoia 2015-06-09 23:41:12 -07:00
parent 3a6fa11575
commit 9003a3e5c5
2 changed files with 10 additions and 11 deletions

View File

@ -1069,12 +1069,12 @@ X11ApplicationCanEnterRandR(void)
if (!XQuartzIsRootless) if (!XQuartzIsRootless)
QuartzShowFullscreen(FALSE); QuartzShowFullscreen(FALSE);
switch (NSRunAlertPanel(title, msg, switch (NSRunAlertPanel(title, @"%@",
NSLocalizedString(@"Allow", NSLocalizedString(@"Allow",
@""), @""),
NSLocalizedString(@"Cancel", NSLocalizedString(@"Cancel",
@""), @""),
NSLocalizedString(@"Always Allow", @""))) { NSLocalizedString(@"Always Allow", @""), msg)) {
case NSAlertOtherReturn: case NSAlertOtherReturn:
[X11App prefs_set_boolean:@PREFS_NO_RANDR_ALERT value:YES]; [X11App prefs_set_boolean:@PREFS_NO_RANDR_ALERT value:YES];
[X11App prefs_synchronize]; [X11App prefs_synchronize];
@ -1122,10 +1122,10 @@ X11ApplicationFatalError(const char *f, va_list args)
*/ */
dispatch_sync(dispatch_get_main_queue(), ^{ dispatch_sync(dispatch_get_main_queue(), ^{
if (NSAlertDefaultReturn == if (NSAlertDefaultReturn ==
NSRunAlertPanel (title, msg, NSRunAlertPanel (title, @"%@",
NSLocalizedString (@"Quit", @""), NSLocalizedString (@"Quit", @""),
NSLocalizedString ( NSLocalizedString (@"Report...", @""),
@"Report...", @""), nil)) { nil, msg)) {
exit (EXIT_FAILURE); exit (EXIT_FAILURE);
} }
}); });
@ -1160,9 +1160,8 @@ check_xinitrc(void)
@"Startup xinitrc dialog"); @"Startup xinitrc dialog");
if (NSAlertDefaultReturn == if (NSAlertDefaultReturn ==
NSRunAlertPanel(nil, msg, NSLocalizedString(@"Yes", @""), NSRunAlertPanel(nil, @"%@", NSLocalizedString(@"Yes", @""),
NSLocalizedString(@"No", NSLocalizedString(@"No", @""), nil, msg)) {
@""), nil)) {
char buf2[1024]; char buf2[1024];
int i = -1; int i = -1;

View File

@ -929,9 +929,9 @@ extern char *bundle_id_prefix;
* and then run the alert on a timer? It seems to work here, so.. * and then run the alert on a timer? It seems to work here, so..
*/ */
return (NSRunAlertPanel(title, msg, NSLocalizedString(@"Quit", @""), NSInteger result = NSRunAlertPanel(title, @"%@", NSLocalizedString(@"Quit", @""),
NSLocalizedString(@"Cancel", @""), nil) NSLocalizedString(@"Cancel", @""), nil, msg);
== NSAlertDefaultReturn) ? NSTerminateNow : NSTerminateCancel; return (result == NSAlertDefaultReturn) ? NSTerminateNow : NSTerminateCancel;
} }
- (void) applicationWillTerminate:(NSNotification *)aNotification _X_NORETURN - (void) applicationWillTerminate:(NSNotification *)aNotification _X_NORETURN