RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: j...@rpm5.org Module: rpm Date: 10-Sep-2014 22:11:21 Branch: rpm-5_4 Handle: 2014091020112000 Modified files: (Branch: rpm-5_4) rpm/rpmio rpmpgp.h Log: - clang: fix -fsanitize=integer issues. Summary: Revision Changes Path 2.108.2.12 +6 -3 rpm/rpmio/rpmpgp.h ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/rpmio/rpmpgp.h ============================================================================ $ cvs diff -u -r2.108.2.11 -r2.108.2.12 rpmpgp.h --- rpm/rpmio/rpmpgp.h 5 May 2014 19:16:32 -0000 2.108.2.11 +++ rpm/rpmio/rpmpgp.h 10 Sep 2014 20:11:20 -0000 2.108.2.12 @@ -1038,7 +1038,8 @@ { unsigned int i = 0; size_t nb = (nbytes <= sizeof(i) ? nbytes : sizeof(i)); - while (nb--) + size_t ix; + for (ix = 0; ix < nb; ix++) i = (i << 8) | *s++; return i; } @@ -1103,7 +1104,8 @@ /*@modifies *t @*/ { static char hex[] = "0123456789abcdef"; - while (nbytes-- > 0) { + size_t ix; + for (ix = 0; ix < nbytes; ix++) { unsigned int i; i = (unsigned int) *s++; *t++ = hex[ (i >> 4) & 0xf ]; @@ -1675,8 +1677,9 @@ { unsigned int crc = CRC24_INIT; int i; + size_t ix; - while (len--) { + for (ix = 0; ix < len; ix++) { crc ^= (*octets++) << 16; for (i = 0; i < 8; i++) { crc <<= 1; @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org