From 75fca2aa3a35362ecff27f0c3041d3f511b51275 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Wed, 3 Jul 2019 03:24:05 +0000 Subject: snprintf/vsnprintf return < 0 on error, rather than -1. --- usr.sbin/iscsid/pdu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.sbin/iscsid') 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 @@ -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; -- cgit v1.2.3