From 13a2c009c4849e13296f6871f320117a5ca78c7f Mon Sep 17 00:00:00 2001 From: gilles Date: Sat, 19 Apr 2014 14:21:26 +0000 Subject: [PATCH] (void) cast strlcpy() calls that cannot truncate --- usr.sbin/smtpd/table_socketmap.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/usr.sbin/smtpd/table_socketmap.c b/usr.sbin/smtpd/table_socketmap.c index 174004a4ca1..ea49af80b56 100644 --- a/usr.sbin/smtpd/table_socketmap.c +++ b/usr.sbin/smtpd/table_socketmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: table_socketmap.c,v 1.2 2014/02/04 16:41:08 eric Exp $ */ +/* $OpenBSD: table_socketmap.c,v 1.3 2014/04/19 14:21:26 gilles Exp $ */ /* * Copyright (c) 2014 Gilles Chehade @@ -146,7 +146,7 @@ table_socketmap_query(const char *name, const char *key) buf = fgetln(sockstream, &len); if (buf == NULL) { log_warnx("warn: table-socketmap: socketmap has lost its socket"); - strlcpy(repbuffer, "lost connection to socket", sizeof repbuffer); + (void)strlcpy(repbuffer, "lost connection to socket", sizeof repbuffer); ret = SM_PERM; goto err; } @@ -155,7 +155,7 @@ table_socketmap_query(const char *name, const char *key) else { if ((lbuf = malloc(len + 1)) == NULL) { log_warnx("warn: table-socketmap: memory exhaustion"); - strlcpy(repbuffer, "memory exhaustion", sizeof repbuffer); + (void)strlcpy(repbuffer, "memory exhaustion", sizeof repbuffer); ret = SM_PERM; goto err; } @@ -169,7 +169,7 @@ table_socketmap_query(const char *name, const char *key) if (strlcpy(repbuffer, buf, sizeof repbuffer) >= sizeof repbuffer) { log_warnx("warn: table-socketmap: socketmap reply too large (>%zu bytes)", sizeof repbuffer); - strlcpy(repbuffer, "socketmap reply too large", sizeof repbuffer); + (void)strlcpy(repbuffer, "socketmap reply too large", sizeof repbuffer); ret = SM_PERM; goto err; } @@ -196,7 +196,7 @@ table_socketmap_query(const char *name, const char *key) } else { ret = SM_PERM; - strlcpy(repbuffer, "unrecognized socketmap reply", sizeof repbuffer); + (void)strlcpy(repbuffer, "unrecognized socketmap reply", sizeof repbuffer); } err: -- 2.20.1