summaryrefslogtreecommitdiff
path: root/rpmqv.c
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2003-01-22 12:28:41 +0000
committerjbj <devnull@localhost>2003-01-22 12:28:41 +0000
commitde2448bccde0147dfa8cbbe8344691a7e0b118de (patch)
treeb5ca008521fc4816b75fc3b99e9fa2323e1d7309 /rpmqv.c
parentff2846d708c5bc2d0068a84f4c280c28e92a1319 (diff)
downloadlibrpm-tizen-de2448bccde0147dfa8cbbe8344691a7e0b118de.tar.gz
librpm-tizen-de2448bccde0147dfa8cbbe8344691a7e0b118de.tar.bz2
librpm-tizen-de2448bccde0147dfa8cbbe8344691a7e0b118de.zip
Exit non-zero with bogus args.
CVS patchset: 6021 CVS date: 2003/01/22 12:28:41
Diffstat (limited to 'rpmqv.c')
-rwxr-xr-xrpmqv.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/rpmqv.c b/rpmqv.c
index ae2afa2f1..c557d96f9 100755
--- a/rpmqv.c
+++ b/rpmqv.c
@@ -793,9 +793,6 @@ ia->probFilter |= RPMPROB_FILTER_OLDPACKAGE;
qva->qva_specQuery = rpmspecQuery;
ec = rpmcliQuery(ts, qva, (const char **) poptGetArgs(optCon));
qva->qva_specQuery = NULL;
-
- /* XXX don't overflow single byte exit status */
- if (ec > 255) ec = 255;
break;
case MODE_VERIFY:
@@ -807,8 +804,6 @@ ia->probFilter |= RPMPROB_FILTER_OLDPACKAGE;
if (qva->qva_source != RPMQV_ALL && !poptPeekArg(optCon))
argerror(_("no arguments given for verify"));
ec = rpmcliVerify(ts, qva, (const char **) poptGetArgs(optCon));
- /* XXX don't overflow single byte exit status */
- if (ec > 255) ec = 255;
} break;
#endif /* IAM_RPMQV */
@@ -825,8 +820,6 @@ ia->probFilter |= RPMPROB_FILTER_OLDPACKAGE;
argerror(_("no arguments given"));
ka->passPhrase = passPhrase;
ec = rpmcliSign(ts, ka, (const char **)poptGetArgs(optCon));
- /* XXX don't overflow single byte exit status */
- if (ec > 255) ec = 255;
break;
#endif /* IAM_RPMK */
@@ -856,6 +849,7 @@ ia->probFilter |= RPMPROB_FILTER_OLDPACKAGE;
case MODE_UNKNOWN:
if (poptPeekArg(optCon) != NULL || argc <= 1 || rpmIsVerbose())
printUsage(optCon, stdout, 0);
+ ec = argc;
break;
}
@@ -903,6 +897,10 @@ exit:
muntrace(); /* Trace malloc only if MALLOC_TRACE=mtrace-output-file. */
/*@=noeffect@*/
#endif
+
+ /* XXX don't overflow single byte exit status */
+ if (ec > 255) ec = 255;
+
/*@-globstate@*/
return ec;
/*@=globstate@*/