summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordevzero2000 <devzero2000>2010-07-23 13:22:55 +0000
committerdevzero2000 <devzero2000>2010-07-23 13:22:55 +0000
commit8c7d0727c36e9f0a79974624d99072a9fd05a6d2 (patch)
tree5d860fbbe733417a2f26209b70ce4e8a69726b3d
parentd658b4ec8673e299a10344e3cfe22ebc999ed688 (diff)
downloadlibpopt-8c7d0727c36e9f0a79974624d99072a9fd05a6d2.tar.gz
(style) reduce the scope of variables. drop cppcheck minor warn
-rw-r--r--poptconfig.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/poptconfig.c b/poptconfig.c
index 8750f4d..5b286c7 100644
--- a/poptconfig.c
+++ b/poptconfig.c
@@ -393,7 +393,6 @@ int poptReadConfigFile(poptContext con, const char * fn)
const char *se;
char *t, *te;
int rc;
- int xx;
if ((rc = poptReadFile(fn, &b, &nb, POPT_READFILE_TRIMNEWLINES)) != 0)
return (errno == ENOENT ? 0 : rc);
@@ -411,8 +410,10 @@ int poptReadConfigFile(poptContext con, const char * fn)
*te = '\0';
te = t;
while (*te && _isspaceptr(te)) te++;
- if (*te && *te != '#')
- xx = poptConfigLine(con, te);
+ if (*te && *te != '#') {
+ int xx;
+ xx = poptConfigLine(con, te); /* XXX: unchecked */
+ }
/*@switchbreak@*/ break;
/*@-usedef@*/ /* XXX *se may be uninitialized */
case '\\':
@@ -511,9 +512,9 @@ int poptReadDefaultConfig(poptContext con, /*@unused@*/ UNUSED(int useEnv))
if (!stat("/etc/popt.d", &sb) && S_ISDIR(sb.st_mode)) {
const char ** av = NULL;
int ac = 0;
- int i;
if ((rc = poptGlob(con, "/etc/popt.d/*", &ac, &av)) == 0) {
+ int i;
for (i = 0; rc == 0 && i < ac; i++) {
const char * fn = av[i];
if (fn == NULL || strstr(fn, ".rpmnew") || strstr(fn, ".rpmsave"))