From aff2fb7a65a9fc40220d971fba8ba3cf1eeeee9f Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Mon, 7 Feb 2005 22:20:03 +0000 Subject: [PATCH] r5269: BUG 858: fix order of popt args evalution so we don't crash when given no command line args --- source/utils/profiles.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) { -- 2.47.3