diff options
| author | agc <agc@NetBSD.org> | 1998-10-08 12:15:24 +0000 |
|---|---|---|
| committer | agc <agc@NetBSD.org> | 1998-10-08 12:15:24 +0000 |
| commit | e5d1fd5f5abea13dd0103921622c104e87f9e114 (patch) | |
| tree | eb17ed74d3f41a73f7592515b884b753248949de /usr.sbin/pkg_install/lib/exec.c | |
| parent | 3e9d54f492926e9b677064b1e375548d7c163f93 (diff) | |
Get rid of some lint.
No functional changes.
Diffstat (limited to 'usr.sbin/pkg_install/lib/exec.c')
| -rw-r--r-- | usr.sbin/pkg_install/lib/exec.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/usr.sbin/pkg_install/lib/exec.c b/usr.sbin/pkg_install/lib/exec.c index ff56d6a756d..766369de23b 100644 --- a/usr.sbin/pkg_install/lib/exec.c +++ b/usr.sbin/pkg_install/lib/exec.c @@ -1,11 +1,11 @@ -/* $NetBSD: exec.c,v 1.4 1997/10/17 14:54:26 lukem Exp $ */ +/* $NetBSD: exec.c,v 1.5 1998/10/08 12:15:24 agc 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.4 1997/10/17 14:54:26 lukem Exp $"); +__RCSID("$NetBSD: exec.c,v 1.5 1998/10/08 12:15:24 agc Exp $"); #endif #endif @@ -40,29 +40,29 @@ __RCSID("$NetBSD: exec.c,v 1.4 1997/10/17 14:54:26 lukem Exp $"); int vsystem(const char *fmt, ...) { - va_list args; - char *cmd; - int ret, maxargs; + va_list args; + char *cmd; + size_t maxargs; + int ret; - maxargs = sysconf(_SC_ARG_MAX); - maxargs -= 32; /* some slop for the sh -c */ - cmd = malloc(maxargs); - if (!cmd) { - warnx("vsystem can't alloc arg space"); - return 1; - } + maxargs = (size_t) sysconf(_SC_ARG_MAX); + maxargs -= 32; /* some slop for the sh -c */ + if ((cmd = (char *) malloc(maxargs)) == (char *) NULL) { + warnx("vsystem can't alloc arg space"); + return 1; + } - va_start(args, fmt); - if (vsnprintf(cmd, maxargs, fmt, args) > maxargs) { - warnx("vsystem args are too long"); - return 1; - } + va_start(args, fmt); + if (vsnprintf(cmd, maxargs, fmt, args) > maxargs) { + warnx("vsystem args are too long"); + return 1; + } #ifdef DEBUG -printf("Executing %s\n", cmd); + printf("Executing %s\n", cmd); #endif - ret = system(cmd); - va_end(args); - free(cmd); - return ret; + ret = system(cmd); + va_end(args); + free(cmd); + return ret; } |
