summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2005-03-11 21:20:15 +0000
committerrillig <rillig@pkgsrc.org>2005-03-11 21:20:15 +0000
commitfa4f8e50b7a7fe07ecc136eb4a7322216d7e2ac5 (patch)
tree0d77dc9fea2409657e8b1ae26850fa5f02b6916d /pkgtools
parent9815ec1903baee44d004fec9dd711e2c32ee2d0a (diff)
downloadpkgsrc-fa4f8e50b7a7fe07ecc136eb4a7322216d7e2ac5.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.c12
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 {