(void) cast snprintf() calls that cannot truncate (and would be harmless
authorgilles <gilles@openbsd.org>
Sat, 19 Apr 2014 17:36:54 +0000 (17:36 +0000)
committergilles <gilles@openbsd.org>
Sat, 19 Apr 2014 17:36:54 +0000 (17:36 +0000)
otherwise)

usr.sbin/smtpd/ioev.c

index eddaaf5..c1d6736 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ioev.c,v 1.17 2014/04/19 12:48:54 gilles Exp $        */
+/*     $OpenBSD: ioev.c,v 1.18 2014/04/19 17:36:54 gilles Exp $        */
 /*      
  * Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
  *
@@ -88,7 +88,7 @@ io_strio(struct io *io)
        ssl[0] = '\0';
 #ifdef IO_SSL
        if (io->ssl) {
-               snprintf(ssl, sizeof ssl, " ssl=%s:%s:%d",
+               (void)snprintf(ssl, sizeof ssl, " ssl=%s:%s:%d",
                    SSL_get_cipher_version(io->ssl),
                    SSL_get_cipher_name(io->ssl),
                    SSL_get_cipher_bits(io->ssl, NULL));
@@ -96,11 +96,11 @@ io_strio(struct io *io)
 #endif
 
        if (io->iobuf == NULL)
-               snprintf(buf, sizeof buf,
+               (void)snprintf(buf, sizeof buf,
                    "<io:%p fd=%d to=%d fl=%s%s>",
                    io, io->sock, io->timeout, io_strflags(io->flags), ssl);
        else
-               snprintf(buf, sizeof buf,
+               (void)snprintf(buf, sizeof buf,
                    "<io:%p fd=%d to=%d fl=%s%s ib=%zu ob=%zu>",
                    io, io->sock, io->timeout, io_strflags(io->flags), ssl,
                    io_pending(io), io_queued(io));
@@ -125,7 +125,7 @@ io_strevent(int evt)
        CASE(IO_TIMEOUT);
        CASE(IO_ERROR);
        default:
-               snprintf(buf, sizeof(buf), "IO_? %d", evt);
+               (void)snprintf(buf, sizeof(buf), "IO_? %d", evt);
                return buf;
        }
 }