From 324a1e84ff12a19c04b55e0cb4bc60db45825da9 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Sat, 28 Mar 2026 08:58:03 +0100 Subject: Fix Linux build problems * Disable deprecated function usage errors * Don't use 'true' as an identifier name * Remove buffer overflow warning. --- common/smtppass.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'common') diff --git a/common/smtppass.c b/common/smtppass.c index 92b7daa..bbd1e8c 100644 --- a/common/smtppass.c +++ b/common/smtppass.c @@ -247,7 +247,7 @@ void sp_init(const char* name) int sp_run(const char* configfile, const char* pidfile, int dbg_level) { int sock; - int true = 1; + int tru = 1; ASSERT(configfile); ASSERT(g_state.name); @@ -317,7 +317,7 @@ int sp_run(const char* configfile, const char* pidfile, int dbg_level) } fcntl(sock, F_SETFD, fcntl(sock, F_GETFD, 0) | FD_CLOEXEC); - setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *)&true, sizeof(true)); + setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *)&tru, sizeof(tru)); /* Unlink the socket file if it exists */ if(SANY_TYPE(g_state.listenaddr) == AF_UNIX) @@ -1811,7 +1811,7 @@ const char kMsgDelimiter[] = ": "; static void vmessage(spctx_t* ctx, int level, int err, const char* msg, va_list ap) { - char buf[MAX_MSGLEN]; + char buf[MAX_MSGLEN] = { 0, }; int e = errno; if(g_state.daemonized) @@ -1839,7 +1839,7 @@ static void vmessage(spctx_t* ctx, int level, int err, strerror_r(e, buf + len, MAX_MSGLEN - len); */ sp_lock(); - strncat(buf, strerror(e), MAX_MSGLEN); + strncat(buf, strerror(e), MAX_MSGLEN - 1); sp_unlock(); } -- cgit v1.2.3