Windows warning bit in windsys.c
windows/windsys.c:263:15: warning: format string is not a string literal
(potentially insecure) [-Wformat-security]
263 | msmsg(buf);
| ^~~
../sys/windows/windsys.c:263:15: note: treat the string as an argument to avoid this
263 | msmsg(buf);
| ^
| "%s",
../sys/windows/windsys.c:267:20: warning: format string is not a string literal
(potentially insecure) [-Wformat-security]
267 | raw_printf(buf);
| ^~~
This commit is contained in:
@@ -25,6 +25,7 @@
|
|||||||
#include "wintty.h"
|
#include "wintty.h"
|
||||||
#endif
|
#endif
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#include <VersionHelpers.h>
|
#include <VersionHelpers.h>
|
||||||
@@ -260,11 +261,11 @@ VA_DECL(const char *, s)
|
|||||||
buf[0] = '\n';
|
buf[0] = '\n';
|
||||||
(void) vsnprintf(&buf[1], sizeof buf - (1 + sizeof "\n"), s, VA_ARGS);
|
(void) vsnprintf(&buf[1], sizeof buf - (1 + sizeof "\n"), s, VA_ARGS);
|
||||||
Strcat(buf, "\n");
|
Strcat(buf, "\n");
|
||||||
msmsg(buf);
|
msmsg("%s", buf);
|
||||||
} else {
|
} else {
|
||||||
(void) vsnprintf(buf, sizeof buf - sizeof "\n", s, VA_ARGS);
|
(void) vsnprintf(buf, sizeof buf - sizeof "\n", s, VA_ARGS);
|
||||||
Strcat(buf, "\n");
|
Strcat(buf, "\n");
|
||||||
raw_printf(buf);
|
raw_printf("%s",buf);
|
||||||
}
|
}
|
||||||
#ifdef MSWIN_GRAPHICS
|
#ifdef MSWIN_GRAPHICS
|
||||||
if (windowprocs.win_raw_print == mswin_raw_print)
|
if (windowprocs.win_raw_print == mswin_raw_print)
|
||||||
|
|||||||
Reference in New Issue
Block a user