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
commitdfd5cc37b043f2a31e153ed125a68b4a2d171503 (patch)
tree0d77dc9fea2409657e8b1ae26850fa5f02b6916d /pkgtools
parent0d1d63fe2e07754596e8333d25c9f3ee041c9998 (diff)
downloadpkgsrc-dfd5cc37b043f2a31e153ed125a68b4a2d171503.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 {