From 3363509bc613c9102277b1b01514330bef74a13b Mon Sep 17 00:00:00 2001 From: gilles Date: Sat, 19 Apr 2014 17:31:35 +0000 Subject: [PATCH] (void) cast snprintf calls that cannot truncate --- usr.sbin/smtpd/delivery_maildir.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/smtpd/delivery_maildir.c b/usr.sbin/smtpd/delivery_maildir.c index 4f854e18526..132d9574704 100644 --- a/usr.sbin/smtpd/delivery_maildir.c +++ b/usr.sbin/smtpd/delivery_maildir.c @@ -1,4 +1,4 @@ -/* $OpenBSD: delivery_maildir.c,v 1.12 2013/05/24 17:03:14 eric Exp $ */ +/* $OpenBSD: delivery_maildir.c,v 1.13 2014/04/19 17:31:35 gilles Exp $ */ /* * Copyright (c) 2011 Gilles Chehade @@ -71,7 +71,7 @@ delivery_maildir_open(struct deliver *deliver) error("mkdir tmp failed"); if (mkdir("new", 0700) < 0 && errno != EEXIST) error("mkdir new failed"); - snprintf(tmp, sizeof tmp, "tmp/%lld.%d.%s", + (void)snprintf(tmp, sizeof tmp, "tmp/%lld.%d.%s", (long long int) time(NULL), getpid(), env->sc_hostname); fd = open(tmp, O_CREAT | O_EXCL | O_WRONLY, 0600); @@ -91,7 +91,7 @@ delivery_maildir_open(struct deliver *deliver) error2("fsync"); if (fclose(fp) == EOF) error2("fclose"); - snprintf(new, sizeof new, "new/%s", tmp + 4); + (void)snprintf(new, sizeof new, "new/%s", tmp + 4); if (rename(tmp, new) < 0) error2("cannot rename tmp->new"); _exit(0); -- 2.20.1