check return value of snprintf correctly.
This commit is contained in:
parent
0c63dd3cf2
commit
bf62cfa448
@ -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>
|
#include <sys/cdefs.h>
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
#if 0
|
#if 0
|
||||||
static const char *rcsid = "from FreeBSD Id: exec.c,v 1.6 1997/10/08 07:47:50 charnier Exp";
|
static const char *rcsid = "from FreeBSD Id: exec.c,v 1.6 1997/10/08 07:47:50 charnier Exp";
|
||||||
#else
|
#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
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ vsystem(const char *fmt,...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
va_start(args, 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");
|
warnx("vsystem args are too long");
|
||||||
va_end(args);
|
va_end(args);
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user