mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-06-30 11:02:48 -05:00
Fix an assortment of dupprintf() format string bugs.
I've enabled gcc's format-string checking on dupprintf, by declaring it in misc.h to have the appropriate GNU-specific attribute. This pointed out a selection of warnings, which I've fixed. [originally from svn r10084]
This commit is contained in:
@ -2901,7 +2901,7 @@ char *setup_fonts_ucs(struct gui_data *inst)
|
||||
for (i = 0; i < 2; i++)
|
||||
if (fonts[i])
|
||||
unifont_destroy(fonts[i]);
|
||||
return dupprintf("%s: unable to load wide font \"%s\"", fs->name);
|
||||
return dupprintf("unable to load wide font \"%s\"", fs->name);
|
||||
}
|
||||
} else {
|
||||
fonts[2] = NULL;
|
||||
@ -2917,8 +2917,7 @@ char *setup_fonts_ucs(struct gui_data *inst)
|
||||
for (i = 0; i < 3; i++)
|
||||
if (fonts[i])
|
||||
unifont_destroy(fonts[i]);
|
||||
return dupprintf("%s: unable to load wide bold font \"%s\"",
|
||||
fs->name);
|
||||
return dupprintf("unable to load wide bold font \"%s\"", fs->name);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -204,7 +204,7 @@ static char *get_ttychar(struct termios *t, int index)
|
||||
cc_t c = t->c_cc[index];
|
||||
#if defined(_POSIX_VDISABLE)
|
||||
if (c == _POSIX_VDISABLE)
|
||||
return dupprintf("");
|
||||
return dupstr("");
|
||||
#endif
|
||||
return dupprintf("^<%d>", c);
|
||||
}
|
||||
|
@ -938,7 +938,7 @@ static const char *pty_init(void *frontend, void **backend_handle, Conf *conf,
|
||||
|
||||
*backend_handle = pty;
|
||||
|
||||
*realhost = dupprintf("\0");
|
||||
*realhost = dupstr("");
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user