summaryrefslogtreecommitdiffstats
path: root/usr.sbin/iscsid
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2019-07-03 03:24:01 +0000
committerderaadt <deraadt@openbsd.org>2019-07-03 03:24:01 +0000
commit515e489c3d599b9cfcdf9cf6842ac49f92e154d6 (patch)
tree9ce211473951e1baf5c99e08c2c35012292670f1 /usr.sbin/iscsid
parentsync (diff)
downloadwireguard-openbsd-515e489c3d599b9cfcdf9cf6842ac49f92e154d6.tar.xz
wireguard-openbsd-515e489c3d599b9cfcdf9cf6842ac49f92e154d6.zip
snprintf/vsnprintf return < 0 on error, rather than -1.
Diffstat (limited to 'usr.sbin/iscsid')
-rw-r--r--usr.sbin/iscsid/pdu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/iscsid/pdu.c b/usr.sbin/iscsid/pdu.c
index d498882d67c..37e2f81d543 100644
--- a/usr.sbin/iscsid/pdu.c
+++ b/usr.sbin/iscsid/pdu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pdu.c,v 1.11 2015/12/05 06:38:18 mmcc Exp $ */
+/* $OpenBSD: pdu.c,v 1.12 2019/07/03 03:24:03 deraadt Exp $ */
/*
* Copyright (c) 2009 Claudio Jeker <claudio@openbsd.org>
@@ -75,7 +75,7 @@ text_to_pdu(struct kvp *k, struct pdu *p)
nk = 0;
while(k[nk].key) {
n = snprintf(s, rem, "%s=%s", k[nk].key, k[nk].value);
- if (n == -1 || (size_t)n >= rem)
+ if (n < 0 || (size_t)n >= rem)
fatalx("text_to_pdu");
rem -= n + 1;
s += n + 1;