From 36ca37aa3d669a66a19100f4e2564d6cd1a1b999 Mon Sep 17 00:00:00 2001 From: Eduardo Chappa Date: Thu, 19 Aug 2021 21:15:42 -0600 Subject: * Clear out some warnings given by gcc-10. --- imap/src/osdep/unix/dummy.c | 2 +- imap/src/osdep/unix/tcp_unix.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'imap/src/osdep/unix') diff --git a/imap/src/osdep/unix/dummy.c b/imap/src/osdep/unix/dummy.c index 244a13cd..646f67ea 100644 --- a/imap/src/osdep/unix/dummy.c +++ b/imap/src/osdep/unix/dummy.c @@ -519,7 +519,7 @@ long dummy_delete (MAILSTREAM *stream,char *mailbox) struct stat sbuf; char *s,tmp[MAILTMPLEN]; if (!(s = dummy_file (tmp,mailbox))) { - sprintf (tmp,"Can't delete - invalid name: %.80s",s); + sprintf (tmp,"Can't delete - invalid name: %.80s",mailbox); MM_LOG (tmp,ERROR); } /* no trailing / (workaround BSD kernel bug) */ diff --git a/imap/src/osdep/unix/tcp_unix.c b/imap/src/osdep/unix/tcp_unix.c index 6ddac4df..cf18bb6f 100644 --- a/imap/src/osdep/unix/tcp_unix.c +++ b/imap/src/osdep/unix/tcp_unix.c @@ -988,7 +988,7 @@ char *tcp_canonical (char *name) char *tcp_name (struct sockaddr *sadr,long flag) { - char *ret,*t,adr[MAILTMPLEN],tmp[MAILTMPLEN],buf[NI_MAXHOST]; + char *ret,*t,adr[MAILTMPLEN],tmp[MAILTMPLEN+1],buf[NI_MAXHOST]; sprintf (ret = adr,"[%.80s]",ip_sockaddrtostring (sadr,buf)); if (allowreversedns) { blocknotify_t bn = (blocknotify_t)mail_parameters(NIL,GET_BLOCKNOTIFY,NIL); @@ -1002,7 +1002,8 @@ char *tcp_name (struct sockaddr *sadr,long flag) /* translate address to name */ if ((t = tcp_name_valid (ip_sockaddrtoname (sadr,buf))) != NULL) { /* produce verbose form if needed */ - if (flag) sprintf (ret = tmp,"%s %s",t,adr); + if (flag) sprintf (ret = tmp,"%.*s %.*s", (int) strlen(t), t, + MAILTMPLEN - (int)strlen(t) - 1,adr); else ret = t; } (*bn) (BLOCK_NONSENSITIVE,data); -- cgit v1.2.3-70-g09d2