]> granicus.if.org Git - curl/commitdiff
gcc7: fix ‘*’ in boolean context, suggest ‘&&’ instead [-Wint-in-bool-context]
authorAlexis La Goutte <alexis.lagoutte@gmail.com>
Thu, 30 Mar 2017 12:14:53 +0000 (14:14 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 30 Mar 2017 12:29:08 +0000 (14:29 +0200)
Closes #1371

src/tool_cb_hdr.c
src/tool_cb_wrt.c

index 6e23d1da83dd80da3000fd78c198ae557dd5f276..0e13eec50c47844f6c7bd620d9119f9c79660404 100644 (file)
@@ -56,7 +56,7 @@ size_t tool_header_cb(char *ptr, size_t size, size_t nmemb, void *userdata)
    * it does not match then it fails with CURLE_WRITE_ERROR. So at this
    * point returning a value different from sz*nmemb indicates failure.
    */
-  size_t failure = (size * nmemb) ? 0 : 1;
+  size_t failure = (size && nmemb) ? 0 : 1;
 
   if(!heads->config)
     return failure;
index 5c28a2cf898892063242570740d172076ae005a6..6c08943eae8749c631ea4c1c06f438622f814125 100644 (file)
@@ -84,7 +84,7 @@ size_t tool_write_cb(char *buffer, size_t sz, size_t nmemb, void *userdata)
    * it does not match then it fails with CURLE_WRITE_ERROR. So at this
    * point returning a value different from sz*nmemb indicates failure.
    */
-  const size_t failure = (sz * nmemb) ? 0 : 1;
+  const size_t failure = (sz && nmemb) ? 0 : 1;
 
   if(!config)
     return failure;