(void) cast strlcpy() and snprintf() that cannot truncate
authorgilles <gilles@openbsd.org>
Sat, 19 Apr 2014 13:40:24 +0000 (13:40 +0000)
committergilles <gilles@openbsd.org>
Sat, 19 Apr 2014 13:40:24 +0000 (13:40 +0000)
usr.sbin/smtpd/queue.c

index 62ab6f9..5f68ad8 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: queue.c,v 1.161 2014/04/08 15:25:43 eric Exp $        */
+/*     $OpenBSD: queue.c,v 1.162 2014/04/19 13:40:24 gilles Exp $      */
 
 /*
  * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -688,10 +688,10 @@ queue_log(const struct envelope *e, const char *prefix, const char *status)
 {
        char rcpt[SMTPD_MAXLINESIZE];
        
-       strlcpy(rcpt, "-", sizeof rcpt);
+       (void)strlcpy(rcpt, "-", sizeof rcpt);
        if (strcmp(e->rcpt.user, e->dest.user) ||
            strcmp(e->rcpt.domain, e->dest.domain))
-               snprintf(rcpt, sizeof rcpt, "%s@%s",
+               (void)snprintf(rcpt, sizeof rcpt, "%s@%s",
                    e->rcpt.user, e->rcpt.domain);
        
        log_info("%s: %s for %016" PRIx64 ": from=<%s@%s>, to=<%s@%s>, "