diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-01-02 13:55:16 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-01-02 13:55:16 +0200 |
commit | 519eaaf236866602e1f05cf138ebb263b465f2b7 (patch) | |
tree | 4a0b77ccbed218758ca74c3b038a34c10d768e11 /lib | |
parent | d772111b9131a9fc7ad4da1008ba6fb202344a2f (diff) | |
download | rpm-519eaaf236866602e1f05cf138ebb263b465f2b7.tar.gz rpm-519eaaf236866602e1f05cf138ebb263b465f2b7.tar.bz2 rpm-519eaaf236866602e1f05cf138ebb263b465f2b7.zip |
Assorted int -> size_t corrections for string lengths
Diffstat (limited to 'lib')
-rw-r--r-- | lib/fsm.c | 9 | ||||
-rw-r--r-- | lib/legacy.c | 2 | ||||
-rw-r--r-- | lib/package.c | 4 | ||||
-rw-r--r-- | lib/poptQV.c | 2 | ||||
-rw-r--r-- | lib/psm.c | 8 | ||||
-rw-r--r-- | lib/rpmfi.c | 6 | ||||
-rw-r--r-- | lib/rpmfi_internal.h | 6 | ||||
-rw-r--r-- | lib/transaction.c | 12 |
8 files changed, 25 insertions, 24 deletions
@@ -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); diff --git a/lib/legacy.c b/lib/legacy.c index 0d29c6cb3..a856c4e26 100644 --- a/lib/legacy.c +++ b/lib/legacy.c @@ -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; diff --git a/lib/package.c b/lib/package.c index 0db650c54..8fd94f62a 100644 --- a/lib/package.c +++ b/lib/package.c @@ -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; } diff --git a/lib/poptQV.c b/lib/poptQV.c index 7d9862f28..ca4e60966 100644 --- a/lib/poptQV.c +++ b/lib/poptQV.c @@ -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; diff --git a/lib/rpmfi.c b/lib/rpmfi.c index 8c05d2942..0201502bb 100644 --- a/lib/rpmfi.c +++ b/lib/rpmfi.c @@ -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; diff --git a/lib/rpmfi_internal.h b/lib/rpmfi_internal.h index 4b68806c6..93658b2ce 100644 --- a/lib/rpmfi_internal.h +++ b/lib/rpmfi_internal.h @@ -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. */ diff --git a/lib/transaction.c b/lib/transaction.c index 3cefe50af..cdc2bce80 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -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; |