From 8b22282c564763bb3fb6baf5aae7b341dfbb33db Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 21 Jan 2024 15:35:09 -0800 Subject: Handle -Wformat-security warnings from the DEBUG macro Signed-off-by: Alan Coopersmith --- toc.c | 7 +------ xmh.h | 2 +- 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) \ -- cgit v1.2.3