From: Gerald Carter Date: Mon, 7 Feb 2005 22:20:03 +0000 (+0000) Subject: r5269: BUG 858: fix order of popt args evalution so we don't crash when given no... X-Git-Tag: samba-misc-tags/initial-v3-0-unstable~5285 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aff2fb7a65a9fc40220d971fba8ba3cf1eeeee9f;p=thirdparty%2Fsamba.git r5269: BUG 858: fix order of popt args evalution so we don't crash when given no command line args --- diff --git a/source/utils/profiles.c b/source/utils/profiles.c index a31674dfb2e..6911341708f 100644 --- a/source/utils/profiles.c +++ b/source/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) {