From: gilles Date: Sat, 19 Apr 2014 14:32:03 +0000 (+0000) Subject: (void) cast a strlcpy that cannot truncate X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=9b886139d77299a2e03d617c1c267367f010ede2;p=openbsd (void) cast a strlcpy that cannot truncate --- diff --git a/usr.sbin/smtpd/util.c b/usr.sbin/smtpd/util.c index 5db00535f30..f74738a5c1c 100644 --- a/usr.sbin/smtpd/util.c +++ b/usr.sbin/smtpd/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.108 2014/02/04 10:38:06 eric Exp $ */ +/* $OpenBSD: util.c,v 1.109 2014/04/19 14:32:03 gilles Exp $ */ /* * Copyright (c) 2000,2001 Markus Friedl. All rights reserved. @@ -353,7 +353,7 @@ mvpurge(char *from, char *to) retry = 0; again: - snprintf(buf, sizeof buf, "%s%s%u", to, sep, arc4random()); + (void)snprintf(buf, sizeof buf, "%s%s%u", to, sep, arc4random()); if (rename(from, buf) == -1) { /* ENOTDIR has actually 2 meanings, and incorrect input * could lead to an infinite loop. Consider that after @@ -540,7 +540,7 @@ secure_file(int fd, char *path, char *userdir, uid_t uid, int mayread) for (;;) { if ((cp = dirname(buf)) == NULL) return 0; - strlcpy(buf, cp, sizeof(buf)); + (void)strlcpy(buf, cp, sizeof(buf)); if (stat(buf, &st) < 0 || (st.st_uid != 0 && st.st_uid != uid) ||