From 515e489c3d599b9cfcdf9cf6842ac49f92e154d6 Mon Sep 17 00:00:00 2001 From: deraadt Date: Wed, 3 Jul 2019 03:24:01 +0000 Subject: snprintf/vsnprintf return < 0 on error, rather than -1. --- lib/libc/asr/asr_debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/libc/asr/asr_debug.c') diff --git a/lib/libc/asr/asr_debug.c b/lib/libc/asr/asr_debug.c index 141517b8360..9fc5857ebde 100644 --- a/lib/libc/asr/asr_debug.c +++ b/lib/libc/asr/asr_debug.c @@ -1,4 +1,4 @@ -/* $OpenBSD: asr_debug.c,v 1.25 2018/04/28 15:16:49 schwarze Exp $ */ +/* $OpenBSD: asr_debug.c,v 1.26 2019/07/03 03:24:03 deraadt Exp $ */ /* * Copyright (c) 2012 Eric Faurot * @@ -73,7 +73,7 @@ print_rr(const struct asr_dns_rr *rr, char *buf, size_t max) rr->rr_ttl, __p_class(rr->rr_class), __p_type(rr->rr_type)); - if (r == -1) { + if (r < 0 || r >= max) { buf[0] = '\0'; return (buf); } -- cgit v1.2.3-59-g8ed1b