diff --git a/lib/rpmds.c b/lib/rpmds.c index 12c612edc9..20f0382723 100644 --- a/lib/rpmds.c +++ b/lib/rpmds.c @@ -277,7 +277,7 @@ rpmds rpmdsNewPool(rpmstrPool pool, Header h, rpmTagVal tagN, int flags) goto exit; if (headerGet(h, tagN, &names, HEADERGET_MINMEM)) { - struct rpmtd_s evr, flags, tindices; + struct rpmtd_s evr, dflags, tindices; rpm_count_t count = rpmtdCount(&names); headerGet(h, tagEVR, &evr, HEADERGET_MINMEM); @@ -286,9 +286,9 @@ rpmds rpmdsNewPool(rpmstrPool pool, Header h, rpmTagVal tagN, int flags) return NULL; } - headerGet(h, tagF, &flags, HEADERGET_ALLOC); - if (flags.count && flags.count != count) { - rpmtdFreeData(&flags); + headerGet(h, tagF, &dflags, HEADERGET_ALLOC); + if (dflags.count && dflags.count != count) { + rpmtdFreeData(&dflags); return NULL; } @@ -304,7 +304,7 @@ rpmds rpmdsNewPool(rpmstrPool pool, Header h, rpmTagVal tagN, int flags) ds->N = names.count ? rpmtdToPool(&names, ds->pool) : NULL; ds->EVR = evr.count ? rpmtdToPool(&evr, ds->pool): NULL; - ds->Flags = flags.data; + ds->Flags = dflags.data; if (tagTi != RPMTAG_NOT_FOUND) { ds->ti = tindices.data; } diff --git a/lib/rpmfi.c b/lib/rpmfi.c index a503ad9765..90cf358de3 100644 --- a/lib/rpmfi.c +++ b/lib/rpmfi.c @@ -1323,7 +1323,7 @@ static rpmsid * tag2pool(rpmstrPool pool, Header h, rpmTag tag, rpm_count_t size rpmsid *sids = NULL; struct rpmtd_s td; if (headerGet(h, tag, &td, HEADERGET_MINMEM)) { - if ((size >= 0) && (rpmtdCount(&td) == size)) { /* ensure right size */ + if (rpmtdCount(&td) == size) { /* ensure right size */ sids = rpmtdToPool(&td, pool); } rpmtdFreeData(&td); diff --git a/lib/rpmscript.c b/lib/rpmscript.c index 8d5b531f68..f4d1c7ed63 100644 --- a/lib/rpmscript.c +++ b/lib/rpmscript.c @@ -483,15 +483,15 @@ static rpmScript rpmScriptNew(Header h, rpmTagVal tag, const char *body, /* macros need to be expanded before possible queryformat */ if (script->body && (script->flags & RPMSCRIPT_FLAG_EXPAND)) { - char *body = rpmExpand(script->body, NULL); + char *b = rpmExpand(script->body, NULL); free(script->body); - script->body = body; + script->body = b; } if (script->body && (script->flags & RPMSCRIPT_FLAG_QFORMAT)) { /* XXX TODO: handle queryformat errors */ - char *body = headerFormat(h, script->body, NULL); + char *b = headerFormat(h, script->body, NULL); free(script->body); - script->body = body; + script->body = b; } script->nextFileFunc.func = NULL; diff --git a/rpmio/macro.c b/rpmio/macro.c index 536072f7cc..437328e3a7 100644 --- a/rpmio/macro.c +++ b/rpmio/macro.c @@ -613,7 +613,7 @@ static const struct builtins_s* lookupBuiltin(const char *name, size_t nlen) namecmp); } -static const int +static int validName(MacroBuf mb, const char *name, size_t namelen, const char *action) { int rc = 0; diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c index bcae69035c..2439424111 100644 --- a/rpmio/rpmio.c +++ b/rpmio/rpmio.c @@ -1523,7 +1523,7 @@ static FDIO_t findIOT(const char *name) FD_t Fdopen(FD_t ofd, const char *fmode) { - char stdio[20], other[20], zstdio[40]; + char stdio[20], other[20], stdioz[40]; const char *end = NULL; FDIO_t iot = NULL; FD_t fd = ofd; @@ -1538,9 +1538,9 @@ fprintf(stderr, "*** Fdopen(%p,%s) %s\n", fd, fmode, fdbg(fd)); cvtfmode(fmode, stdio, sizeof(stdio), other, sizeof(other), &end, NULL); if (stdio[0] == '\0') return NULL; - zstdio[0] = '\0'; - strncat(zstdio, stdio, sizeof(zstdio) - strlen(zstdio) - 1); - strncat(zstdio, other, sizeof(zstdio) - strlen(zstdio) - 1); + stdioz[0] = '\0'; + strncat(stdioz, stdio, sizeof(stdioz) - strlen(stdioz) - 1); + strncat(stdioz, other, sizeof(stdioz) - strlen(stdioz) - 1); if (end == NULL && other[0] == '\0') return fd; @@ -1555,7 +1555,7 @@ fprintf(stderr, "*** Fdopen(%p,%s) %s\n", fd, fmode, fdbg(fd)); } if (iot && iot->_fdopen) - fd = iot->_fdopen(fd, fdno, zstdio); + fd = iot->_fdopen(fd, fdno, stdioz); DBGIO(fd, (stderr, "==> Fdopen(%p,\"%s\") returns fd %p %s\n", ofd, fmode, (fd ? fd : NULL), fdbg(fd))); return fd;