]> granicus.if.org Git - curl/commitdiff
lib1900.c: Fixed cppcheck error
authorJulien Nabet <serval2412@yahoo.fr>
Wed, 31 Dec 2014 12:25:09 +0000 (13:25 +0100)
committerSteve Holme <steve_holme@hotmail.com>
Wed, 31 Dec 2014 12:45:36 +0000 (12:45 +0000)
lib1900.c:182: (style) Array index 'handlenum' is used before limits
               check

Bug: https://github.com/bagder/curl/pull/133

tests/libtest/lib1900.c

index fa83130b64fa9417b50eb455bc1d9b49a3faf20b..2f64742a15879159700b3d645a5cf286e400e11c 100644 (file)
@@ -179,7 +179,7 @@ int test(char *URL)
       now = tutil_tvnow();
       msnow = now.tv_sec * 1000 + now.tv_usec / 1000;
       mslast = last_handle_add.tv_sec * 1000 + last_handle_add.tv_usec / 1000;
-      if(msnow - mslast >= urltime[handlenum] && handlenum < num_handles) {
+      if((msnow - mslast) >= urltime[handlenum]) {
         fprintf(stdout, "Adding handle %d\n", handlenum);
         setup_handle(URL, m, handlenum);
         last_handle_add = now;