check return value of snprintf correctly.

This commit is contained in:
yamt 2002-06-27 12:05:52 +00:00
parent 0c63dd3cf2
commit bf62cfa448

View File

@ -1,11 +1,11 @@
/* $NetBSD: exec.c,v 1.8 2001/09/24 13:22:37 wiz Exp $ */
/* $NetBSD: exec.c,v 1.9 2002/06/27 12:05:52 yamt Exp $ */
#include <sys/cdefs.h>
#ifndef lint
#if 0
static const char *rcsid = "from FreeBSD Id: exec.c,v 1.6 1997/10/08 07:47:50 charnier Exp";
#else
__RCSID("$NetBSD: exec.c,v 1.8 2001/09/24 13:22:37 wiz Exp $");
__RCSID("$NetBSD: exec.c,v 1.9 2002/06/27 12:05:52 yamt Exp $");
#endif
#endif
@ -52,7 +52,7 @@ vsystem(const char *fmt,...)
}
va_start(args, fmt);
if (vsnprintf(cmd, maxargs, fmt, args) > maxargs) {
if (vsnprintf(cmd, maxargs, fmt, args) >= maxargs) {
warnx("vsystem args are too long");
va_end(args);
return 1;