diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2019-07-03 03:24:05 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2019-07-03 03:24:05 +0000 |
commit | 75fca2aa3a35362ecff27f0c3041d3f511b51275 (patch) | |
tree | d0c647e96313c8d94edf3f50304b78ae1cf249c1 /sbin/isakmpd/policy.c | |
parent | aef6c060ee15355c0490999de3c4679d7bb97e84 (diff) |
snprintf/vsnprintf return < 0 on error, rather than -1.
Diffstat (limited to 'sbin/isakmpd/policy.c')
-rw-r--r-- | sbin/isakmpd/policy.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/isakmpd/policy.c b/sbin/isakmpd/policy.c index ca45fc950f2..f18e1f1a1f1 100644 --- a/sbin/isakmpd/policy.c +++ b/sbin/isakmpd/policy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: policy.c,v 1.100 2019/06/28 13:32:44 deraadt Exp $ */ +/* $OpenBSD: policy.c,v 1.101 2019/07/03 03:24:02 deraadt Exp $ */ /* $EOM: policy.c,v 1.49 2000/10/24 13:33:39 niklas Exp $ */ /* @@ -94,7 +94,7 @@ my_inet_ntop4(const in_addr_t *src, char *dst, size_t size, int normalize) len = snprintf(tmp, sizeof tmp, fmt, ((u_int8_t *)&src2)[0], ((u_int8_t *)&src2)[1], ((u_int8_t *)&src2)[2], ((u_int8_t *)&src2)[3]); - if (len == -1 || len > (int)size) { + if (len < 0 || len > (int)size) { errno = ENOSPC; return 0; } @@ -113,7 +113,7 @@ my_inet_ntop6(const unsigned char *src, char *dst, size_t size) len = snprintf(tmp, sizeof tmp, fmt, src[0], src[1], src[2], src[3], src[4], src[5], src[6], src[7], src[8], src[9], src[10], src[11], src[12], src[13], src[14], src[15]); - if (len == -1 || len > (int)size) { + if (len < 0 || len > (int)size) { errno = ENOSPC; return 0; } |