diff options
author | rillig <rillig> | 2005-03-11 21:20:15 +0000 |
---|---|---|
committer | rillig <rillig> | 2005-03-11 21:20:15 +0000 |
commit | 08e42f59722d01fd7edb8574def2fa4851cc9c19 (patch) | |
tree | 0d77dc9fea2409657e8b1ae26850fa5f02b6916d /pkgtools | |
parent | 29d271beaa346c8e234956d3451abcdefedf85e7 (diff) | |
download | pkgsrc-08e42f59722d01fd7edb8574def2fa4851cc9c19.tar.gz |
Never access argv[i+1] before you know that argv[i] != NULL. Approved
by wiz.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkg_install/files/admin/main.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pkgtools/pkg_install/files/admin/main.c b/pkgtools/pkg_install/files/admin/main.c index ed2da7f2550..75af64029a7 100644 --- a/pkgtools/pkg_install/files/admin/main.c +++ b/pkgtools/pkg_install/files/admin/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.17 2004/12/29 12:16:56 agc Exp $ */ +/* $NetBSD: main.c,v 1.18 2005/03/11 21:20:15 rillig Exp $ */ #if HAVE_CONFIG_H #include "config.h" @@ -8,7 +8,7 @@ #include <sys/cdefs.h> #endif #ifndef lint -__RCSID("$NetBSD: main.c,v 1.17 2004/12/29 12:16:56 agc Exp $"); +__RCSID("$NetBSD: main.c,v 1.18 2005/03/11 21:20:15 rillig Exp $"); #endif /* @@ -511,13 +511,13 @@ main(int argc, char *argv[]) argv++; /* "pmatch" */ - pattern = argv[0]; - pkg = argv[1]; - - if (pattern == NULL || pkg == NULL) { + if (argv[0] == NULL || argv[1] == NULL) { usage(prog); } + pattern = argv[0]; + pkg = argv[1]; + if (pmatch(pattern, pkg)){ return 0; } else { |