r5269: BUG 858: fix order of popt args evalution so we don't crash when given no...
authorGerald Carter <jerry@samba.org>
Mon, 7 Feb 2005 22:20:03 +0000 (22:20 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:55:35 +0000 (10:55 -0500)
(This used to be commit aff2fb7a65a9fc40220d971fba8ba3cf1eeeee9f)

source3/utils/profiles.c

index a31674dfb2e2e80554a42cb7bcff35e8c98bd391..6911341708f6cf414da28b8528323ce28b4b30aa 100644 (file)
@@ -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) {