Turn rpmioSlurp() length argument to unsigned size_t, fix up uses.
authorPanu Matilainen <pmatilai@redhat.com>
Wed, 11 Jul 2007 12:39:51 +0000 (15:39 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Wed, 11 Jul 2007 12:39:51 +0000 (15:39 +0300)
Derived from rpm5.org / Ralf S. Engelschall, I do agree length can't really
be negative...

rpmio/rpmio.c
rpmio/rpmio_internal.h
rpmio/rpmpgp.c

index 9201784..8d436d3 100644 (file)
@@ -3392,7 +3392,7 @@ int rpmioMkpath(const char * path, mode_t mode, uid_t uid, gid_t gid)
 /*@=bounds@*/
 
 /*@-boundswrite@*/
-int rpmioSlurp(const char * fn, const byte ** bp, ssize_t * blenp)
+int rpmioSlurp(const char * fn, const byte ** bp, size_t * blenp)
 {
     static ssize_t blenmax = (32 * BUFSIZ);
     ssize_t blen = 0;
index c2906e8..40c006e 100644 (file)
@@ -627,7 +627,7 @@ int fdFileno(/*@null@*/ void * cookie)
  * @return             0 on success
  */
 int rpmioSlurp(const char * fn,
-                /*@out@*/ const unsigned char ** bp, /*@out@*/ ssize_t * blenp)
+                /*@out@*/ const unsigned char ** bp, /*@out@*/ size_t * blenp)
         /*@globals h_errno, fileSystem, internalState @*/
         /*@modifies *bp, *blenp, fileSystem, internalState @*/;
 
index 628ca2e..feca030 100644 (file)
@@ -1144,7 +1144,7 @@ int pgpPrtPkts(const byte * pkts, unsigned int pktlen, pgpDig dig, int printing)
 pgpArmor pgpReadPkts(const char * fn, const byte ** pkt, size_t * pktlen)
 {
     const byte * b = NULL;
-    ssize_t blen;
+    size_t blen;
     const char * enc = NULL;
     const char * crcenc = NULL;
     byte * dec;