cast (void) this strlcpy(), it can't fail copying a small constant string
authorgilles <gilles@openbsd.org>
Sat, 19 Apr 2014 11:31:06 +0000 (11:31 +0000)
committergilles <gilles@openbsd.org>
Sat, 19 Apr 2014 11:31:06 +0000 (11:31 +0000)
into a much larger buffer

usr.sbin/smtpd/delivery_mbox.c

index 13bb217..19cc61e 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: delivery_mbox.c,v 1.9 2013/05/24 17:03:14 eric Exp $  */
+/*     $OpenBSD: delivery_mbox.c,v 1.10 2014/04/19 11:31:06 gilles Exp $       */
 
 /*
  * Copyright (c) 2011 Gilles Chehade <gilles@poolp.org>
@@ -57,7 +57,7 @@ delivery_mbox_open(struct deliver *deliver)
        environ = environ_new;
 
        if (deliver->from[0] == '\0')
-               strlcpy(deliver->from, "MAILER-DAEMON", sizeof deliver->from);
+               (void)strlcpy(deliver->from, "MAILER-DAEMON", sizeof deliver->from);
        execle(PATH_MAILLOCAL, PATH_MAILLOCAL, "-f", deliver->from,
            deliver->to, (char *)NULL, environ_new);
        perror("execle");