diff options
| author | Stef Walter <swalter@redhat.com> | 2026-03-28 08:58:03 +0100 |
|---|---|---|
| committer | Stef Walter <swalter@redhat.com> | 2026-03-28 08:58:03 +0100 |
| commit | 324a1e84ff12a19c04b55e0cb4bc60db45825da9 (patch) | |
| tree | b4bb629cbffea883086e3a7aad50b2530c404b53 | |
| parent | 67e18f604dfd47a158930d1395a1a8522a0ad958 (diff) | |
Fix Linux build problems
* Disable deprecated function usage errors
* Don't use 'true' as an identifier name
* Remove buffer overflow warning.
| -rw-r--r-- | common/smtppass.c | 8 | ||||
| -rw-r--r-- | configure.in | 2 |
2 files changed, 6 insertions, 4 deletions
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(); } diff --git a/configure.in b/configure.in index 70257eb..b6ce040 100644 --- a/configure.in +++ b/configure.in @@ -51,6 +51,8 @@ AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET +CFLAGS="$CFLAGS -g -O0 -Wall -Wno-deprecated-declarations" + # Debug mode AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], |
