[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/6] Fix GCC compile warning for "format-security"
From: |
Torbjörn SVENSSON |
Subject: |
[PATCH 2/6] Fix GCC compile warning for "format-security" |
Date: |
Fri, 9 Jun 2023 16:09:53 +0200 |
Contributed by STMicroelectronics
Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
---
src/job.c | 2 +-
src/main.c | 4 ++--
src/w32/subproc/w32err.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/job.c b/src/job.c
index 34ef9b80..f7f97010 100644
--- 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;
diff --git a/src/main.c b/src/main.c
index 39e511ff..fffd9900 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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;
diff --git a/src/w32/subproc/w32err.c b/src/w32/subproc/w32err.c
index e947a5b2..42ca595c 100644
--- a/src/w32/subproc/w32err.c
+++ b/src/w32/subproc/w32err.c
@@ -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);
}
/*
--
2.25.1