diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2024-01-21 15:35:09 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2024-01-21 15:36:35 -0800 |
commit | 8b22282c564763bb3fb6baf5aae7b341dfbb33db (patch) | |
tree | 7e7258a42f12b0c78c8ac2ceed0dffce5a993f20 | |
parent | b7d18901774b955e000610b4138e93ed528613f7 (diff) |
Handle -Wformat-security warnings from the DEBUG macro
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | toc.c | 7 | ||||
-rw-r--r-- | xmh.h | 2 |
2 files changed, 2 insertions, 7 deletions
@@ -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) { @@ -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) \ |