]> git.ipfire.org Git - thirdparty/make.git/commitdiff
Fix GCC compile warning format-security on Windows
authorTorbjörn SVENSSON <torbjorn.svensson@foss.st.com>
Fri, 9 Jun 2023 14:09:53 +0000 (16:09 +0200)
committerPaul Smith <psmith@gnu.org>
Sat, 1 Jul 2023 16:49:24 +0000 (12:49 -0400)
* 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.

src/job.c
src/main.c
src/w32/subproc/w32err.c

index 34ef9b804efff8d0c71af106d20a7c1252aa19cc..f7f97010cc079c47682f815f644977f00f972a9e 100644 (file)
--- a/src/job.c
+++ b/src/job.c
@@ -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;
index 9ec8f20a0030e5653abac80b4d94a1067c6d3e7c..26d6ba3432a4ed595f8cbfdff36df5da5aee1f0e 100644 (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;
index e947a5b2c32edf3615a98b0287db71a0a9f65c81..42ca595c3fc33143d5d71e02479d3209be6474b1 100644 (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);
   }
 
   /*