Fix GCC compile warning format-security on Windows

* src/job.c (create_batch_file): Avoid non-static format strings.
* src/main.c (handle_runtime_exceptions): Ditto.
* src/w32/subproc/w32err.c (map_windows32_error_to_string): Ditto.
This commit is contained in:
Torbjörn SVENSSON 2023-06-09 16:09:53 +02:00 committed by Paul Smith
parent 363bdaef8c
commit 8e5c96c318
3 changed files with 4 additions and 4 deletions

View File

@ -362,7 +362,7 @@ create_batch_file (char const *base, int unixy, int *fd)
*fd = -1;
if (error_string == NULL)
error_string = _("Cannot create a temporary file");
O (fatal, NILF, error_string);
OS (fatal, NILF, "%s", error_string);
/* not reached */
return NULL;

View File

@ -955,7 +955,7 @@ handle_runtime_exceptions (struct _EXCEPTION_POINTERS *exinfo)
sprintf (errmsg,
_("%s: Interrupt/Exception caught (code = 0x%lx, addr = 0x%p)\n"),
prg, exrec->ExceptionCode, exrec->ExceptionAddress);
fprintf (stderr, errmsg);
fputs (errmsg, stderr);
exit (255);
}
@ -994,7 +994,7 @@ handle_runtime_exceptions (struct _EXCEPTION_POINTERS *exinfo)
#endif
/* Write the error to stderr too */
fprintf (stderr, errmsg);
fputs (errmsg, stderr);
#ifdef DEBUG
return EXCEPTION_CONTINUE_SEARCH;

View File

@ -56,7 +56,7 @@ map_windows32_error_to_string (DWORD ercode) {
* Special code for winsock error handling.
*/
if (ercode > WSABASEERR) {
O (fatal, NILF, szMessageBuffer);
OS (fatal, NILF, "%s", szMessageBuffer);
}
/*