summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-02-07 22:20:03 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:55:35 -0500
commitc3d7096d18f8fe4d1d0cf366605fe3cc5261acc2 (patch)
tree756062b44aaf4e1f045b469c4f4b8ed9d04915c5
parentd09914d218c53b92ffcd4a276c3ce3f33ef5389f (diff)
downloadsamba-c3d7096d18f8fe4d1d0cf366605fe3cc5261acc2.tar.gz
samba-c3d7096d18f8fe4d1d0cf366605fe3cc5261acc2.tar.bz2
samba-c3d7096d18f8fe4d1d0cf366605fe3cc5261acc2.zip
r5269: BUG 858: fix order of popt args evalution so we don't crash when given no command line args
(This used to be commit aff2fb7a65a9fc40220d971fba8ba3cf1eeeee9f)
-rw-r--r--source3/utils/profiles.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/utils/profiles.c b/source3/utils/profiles.c
index a31674dfb2..6911341708 100644
--- a/source3/utils/profiles.c
+++ b/source3/utils/profiles.c
@@ -577,6 +577,8 @@ int main(int argc, char *argv[])
}
}
+ poptGetArg(pc); /* To get argv[0] */
+
if (!poptPeekArg(pc)) {
poptPrintUsage(pc, stderr, 0);
exit(1);
@@ -588,8 +590,6 @@ int main(int argc, char *argv[])
exit(252);
}
- poptGetArg(pc); /* To get argv[0] */
-
fd = open(poptPeekArg(pc), O_RDWR, 0000);
if (fd < 0) {