Fix off by one error
authorJonathan Dieter <jdieter@gmail.com>
Tue, 17 Apr 2018 10:54:51 +0000 (13:54 +0300)
committerJonathan Dieter <jdieter@gmail.com>
Tue, 17 Apr 2018 10:54:51 +0000 (13:54 +0300)
src/lib/io.c

index cdca83b44ffa819daa3040ed389e7f6818053a6d..488ee19f75ea73f8e66ac1b0014f0a80c9020fda 100644 (file)
@@ -78,7 +78,7 @@ int read_comp_size(int fd, size_t *val, size_t *length) {
     int i=0;
     for(char c=read_data(fd, data+i, 1); c < 128 && i < MAX_COMP_SIZE;
         i++,c=read_data(fd, data+i, 1));
-    if(i == MAX_COMP_SIZE && data[i] < 128) {
+    if(i == MAX_COMP_SIZE) {
         zck_log(ZCK_LOG_ERROR, "Number too large\n");
         *val = 0;
         return False;