summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2024-01-21 15:35:09 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2024-01-21 15:36:35 -0800
commit8b22282c564763bb3fb6baf5aae7b341dfbb33db (patch)
tree7e7258a42f12b0c78c8ac2ceed0dffce5a993f20
parentb7d18901774b955e000610b4138e93ed528613f7 (diff)
Handle -Wformat-security warnings from the DEBUG macro
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--toc.c7
-rw-r--r--xmh.h2
2 files changed, 2 insertions, 7 deletions
diff --git a/toc.c b/toc.c
index 684a1fd..a018a7a 100644
--- a/toc.c
+++ b/toc.c
@@ -1140,12 +1140,7 @@ Msg TocMsgFromId(Toc toc, int msgid)
l = 0;
h = toc->nummsgs - 1;
if (h < 0) {
- if (app_resources.debug) {
- char str[100];
- snprintf(str, sizeof(str),
- "Toc is empty! folder=%s\n", toc->foldername);
- DEBUG( str )
- }
+ DEBUG1("Toc is empty! folder=%s\n", toc->foldername)
return NULL;
}
while (l < h - 1) {
diff --git a/xmh.h b/xmh.h
index 42459fc..c43cb20 100644
--- a/xmh.h
+++ b/xmh.h
@@ -70,7 +70,7 @@
#define DEBUG(msg) \
if (app_resources.debug) \
- {(void)fprintf(stderr, msg); (void)fflush(stderr);}
+ {(void)fputs(msg, stderr); (void)fflush(stderr);}
#define DEBUG1(msg, arg) \
if (app_resources.debug) \