Assorted int -> size_t corrections for string lengths
This commit is contained in:
parent
d772111b91
commit
519eaaf236
|
@ -286,7 +286,8 @@ void * dnlInitIterator(const FSM_t fsm,
|
|||
|
||||
/* Exclude parent directories that are explicitly included. */
|
||||
for (i = 0; i < fi->fc; i++) {
|
||||
int dil, dnlen, bnlen;
|
||||
int dil;
|
||||
size_t dnlen, bnlen;
|
||||
|
||||
if (!S_ISDIR(fi->fmodes[i]))
|
||||
continue;
|
||||
|
@ -297,7 +298,7 @@ void * dnlInitIterator(const FSM_t fsm,
|
|||
|
||||
for (j = 0; j < fi->dc; j++) {
|
||||
const char * dnl;
|
||||
int jlen;
|
||||
size_t jlen;
|
||||
|
||||
if (!dnli->active[j] || j == dil)
|
||||
continue;
|
||||
|
@ -1081,7 +1082,7 @@ static int fsmRmdirs(FSM_t fsm)
|
|||
dn[0] = '\0';
|
||||
if (fsm->ldn != NULL && fsm->dnlx != NULL)
|
||||
while ((fsm->path = dnlNextIterator(dnli)) != NULL) {
|
||||
int dnlen = strlen(fsm->path);
|
||||
size_t dnlen = strlen(fsm->path);
|
||||
char * te;
|
||||
|
||||
dc = dnlIndex(dnli);
|
||||
|
@ -1136,7 +1137,7 @@ static int fsmMkdirs(FSM_t fsm)
|
|||
fsm->dnlx = (dc ? xcalloc(dc, sizeof(*fsm->dnlx)) : NULL);
|
||||
if (fsm->dnlx != NULL)
|
||||
while ((fsm->path = dnlNextIterator(dnli)) != NULL) {
|
||||
int dnlen = strlen(fsm->path);
|
||||
size_t dnlen = strlen(fsm->path);
|
||||
char * te;
|
||||
|
||||
dc = dnlIndex(dnli);
|
||||
|
|
|
@ -73,7 +73,7 @@ void compressFilelist(Header h)
|
|||
const char ** needle;
|
||||
char savechar;
|
||||
char * baseName;
|
||||
int len;
|
||||
size_t len;
|
||||
|
||||
if (fileNames[i] == NULL) /* XXX can't happen */
|
||||
continue;
|
||||
|
|
|
@ -601,7 +601,7 @@ rpmRC rpmReadHeader(rpmts ts, FD_t fd, Header *hdrp, char ** msg)
|
|||
int32_t dl;
|
||||
int32_t * ei = NULL;
|
||||
size_t uc;
|
||||
int32_t nb;
|
||||
size_t nb;
|
||||
Header h = NULL;
|
||||
rpmRC rc = RPMRC_FAIL; /* assume failure */
|
||||
int xx;
|
||||
|
@ -644,7 +644,7 @@ rpmRC rpmReadHeader(rpmts ts, FD_t fd, Header *hdrp, char ** msg)
|
|||
ei[1] = block[3];
|
||||
if ((xx = timedRead(fd, (char *)&ei[2], nb)) != nb) {
|
||||
(void) snprintf(buf, sizeof(buf),
|
||||
_("hdr blob(%d): BAD, read returned %d\n"), nb, xx);
|
||||
_("hdr blob(%zd): BAD, read returned %d\n"), nb, xx);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
|
|
@ -169,7 +169,7 @@ static void queryArgCallback(poptContext con,
|
|||
if (arg) {
|
||||
char * qf = (char *)qva->qva_queryFormat;
|
||||
if (qf) {
|
||||
int len = strlen(qf) + strlen(arg) + 1;
|
||||
size_t len = strlen(qf) + strlen(arg) + 1;
|
||||
qf = xrealloc(qf, len);
|
||||
strcat(qf, arg);
|
||||
} else {
|
||||
|
|
|
@ -370,8 +370,8 @@ fi->fmd5s = hfd(fi->fmd5s, RPM_FORCEFREE_TYPE);
|
|||
|
||||
/* Build dnl/dil with {_sourcedir, _specdir} as values. */
|
||||
if (i < fi->fc) {
|
||||
int speclen = strlen(_specdir) + 2;
|
||||
int sourcelen = strlen(_sourcedir) + 2;
|
||||
size_t speclen = strlen(_specdir) + 2;
|
||||
size_t sourcelen = strlen(_sourcedir) + 2;
|
||||
char * t;
|
||||
|
||||
fi->dnl = hfd(fi->dnl, RPM_FORCEFREE_TYPE);
|
||||
|
@ -621,8 +621,8 @@ static rpmRC runScript(rpmpsm psm, Header h, rpm_tag_t stag,
|
|||
rpm_count_t numPrefixes;
|
||||
rpm_tagtype_t ipt;
|
||||
const char * oldPrefix;
|
||||
int maxPrefixLength;
|
||||
int len;
|
||||
size_t maxPrefixLength;
|
||||
size_t len;
|
||||
char * prefixBuf = NULL;
|
||||
char * fn = NULL;
|
||||
int xx;
|
||||
|
|
|
@ -646,7 +646,7 @@ Header relocateFileList(const rpmts ts, rpmfi fi,
|
|||
char * fn = NULL;
|
||||
int haveRelocatedFile = 0;
|
||||
int reldel = 0;
|
||||
int len;
|
||||
size_t len;
|
||||
int i, j, xx;
|
||||
|
||||
if (!hge(origH, RPMTAG_PREFIXES, &validType,
|
||||
|
@ -822,7 +822,7 @@ assert(p != NULL);
|
|||
|
||||
for (i = fileCount - 1; i >= 0; i--) {
|
||||
rpmFileTypes ft;
|
||||
int fnlen;
|
||||
size_t fnlen;
|
||||
|
||||
len = reldel +
|
||||
strlen(dirNames[dirIndexes[i]]) + strlen(baseNames[i]) + 1;
|
||||
|
@ -1156,7 +1156,7 @@ rpmfi rpmfiNew(const rpmts ts, Header h, rpm_tag_t tagN, int scareMem)
|
|||
uint32_t * uip;
|
||||
int dnlmax, bnlmax;
|
||||
unsigned char * t;
|
||||
int len;
|
||||
size_t len;
|
||||
int xx;
|
||||
int i;
|
||||
|
||||
|
|
|
@ -103,10 +103,10 @@ struct rpmfi_s {
|
|||
const char * posttransprog;
|
||||
|
||||
char * fn; /*!< File name buffer. */
|
||||
int fnlen; /*!< FIle name buffer length. */
|
||||
size_t fnlen; /*!< FIle name buffer length. */
|
||||
|
||||
int astriplen;
|
||||
int striplen;
|
||||
size_t astriplen;
|
||||
size_t striplen;
|
||||
unsigned int archivePos;
|
||||
unsigned int archiveSize;
|
||||
mode_t dperms; /*!< Directory perms (0755) if not mapped. */
|
||||
|
|
|
@ -253,12 +253,12 @@ static int fpsCompare (const void * one, const void * two)
|
|||
{
|
||||
const struct fingerPrint_s * a = (const struct fingerPrint_s *)one;
|
||||
const struct fingerPrint_s * b = (const struct fingerPrint_s *)two;
|
||||
int adnlen = strlen(a->entry->dirName);
|
||||
int asnlen = (a->subDir ? strlen(a->subDir) : 0);
|
||||
int abnlen = strlen(a->baseName);
|
||||
int bdnlen = strlen(b->entry->dirName);
|
||||
int bsnlen = (b->subDir ? strlen(b->subDir) : 0);
|
||||
int bbnlen = strlen(b->baseName);
|
||||
size_t adnlen = strlen(a->entry->dirName);
|
||||
size_t asnlen = (a->subDir ? strlen(a->subDir) : 0);
|
||||
size_t abnlen = strlen(a->baseName);
|
||||
size_t bdnlen = strlen(b->entry->dirName);
|
||||
size_t bsnlen = (b->subDir ? strlen(b->subDir) : 0);
|
||||
size_t bbnlen = strlen(b->baseName);
|
||||
char * afn, * bfn, * t;
|
||||
int rc = 0;
|
||||
|
||||
|
|
Loading…
Reference in New Issue