INN commit: branches/2.6 (3 files)
INN Commit
rra at isc.org
Thu May 5 12:42:31 UTC 2016
Date: Thursday, May 5, 2016 @ 05:42:31
Author: iulius
Revision: 10014
Unsigned integers cannot be negative (reported by cppcheck)
Modified:
branches/2.6/frontends/getlist.c
branches/2.6/lib/qio.c
branches/2.6/storage/timecaf/caf.c
-----------------------+
frontends/getlist.c | 3 ++-
lib/qio.c | 6 +++---
storage/timecaf/caf.c | 4 ++--
3 files changed, 7 insertions(+), 6 deletions(-)
Modified: frontends/getlist.c
===================================================================
--- frontends/getlist.c 2016-05-05 12:41:49 UTC (rev 10013)
+++ frontends/getlist.c 2016-05-05 12:42:31 UTC (rev 10014)
@@ -237,8 +237,9 @@
break;
case 'p':
port = atoi(optarg);
- if (port <= 0)
+ if (port == 0) {
die("%s is not a valid port number", optarg);
+ }
break;
case 'R':
reader = true;
Modified: lib/qio.c
===================================================================
--- lib/qio.c 2016-05-05 12:41:49 UTC (rev 10013)
+++ lib/qio.c 2016-05-05 12:42:31 UTC (rev 10014)
@@ -144,11 +144,11 @@
while (1) {
nleft = qp->_end - qp->_start;
- /* If nleft <= 0, the buffer currently contains no data that hasn't
- previously been returned by QIOread, so we can overwrite the
+ /* If (unsigned) nleft = 0, the buffer currently contains no data that
+ hasn't previously been returned by QIOread, so we can overwrite the
buffer with new data. Otherwise, first check the existing data
to see if we have a full line. */
- if (nleft <= 0) {
+ if (nleft == 0) {
qp->_start = qp->_buffer;
qp->_end = qp->_buffer;
} else {
Modified: storage/timecaf/caf.c
===================================================================
--- storage/timecaf/caf.c 2016-05-05 12:41:49 UTC (rev 10013)
+++ storage/timecaf/caf.c 2016-05-05 12:42:31 UTC (rev 10014)
@@ -1433,9 +1433,9 @@
return -1;
}
- /* compute amount of actual data in file. */
+ /* compute amount of actual data in file. */
datasize = statbuf.st_size - head.StartDataBlock;
- if (datasize <= 0) {
+ if (datasize == 0) {
/* nothing in the file, set percentfree==0 so won't bother cleaning */
percentfree = 0;
} else {
More information about the inn-committers
mailing list