]> granicus.if.org Git - curl/commitdiff
- Fabian Keil ran clang on the (lib)curl code, found a bunch of warnings and
authorDaniel Stenberg <daniel@haxx.se>
Wed, 10 Jun 2009 21:26:11 +0000 (21:26 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 10 Jun 2009 21:26:11 +0000 (21:26 +0000)
  contributed a range of patches to fix them.

CHANGES
RELEASE-NOTES
lib/cookie.c
lib/dict.c
lib/http.c
lib/http_chunks.c
lib/sendf.c
lib/ssluse.c
lib/url.c
src/main.c

diff --git a/CHANGES b/CHANGES
index aec53194cf324450ec56da9d62d9336874db83d9..b65b41721ead599e331ed6a6146db9ef551d7a1b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,10 @@
 
                                   Changelog
 
+Daniel Stenberg (10 Jun 2009)
+- Fabian Keil ran clang on the (lib)curl code, found a bunch of warnings and
+  contributed a range of patches to fix them.
+
 Yang Tse (9 Jun 2009)
 - Daniel Steinberg pointed out that Curl_FormInit() in formdata.c was not
   initializing the fread callback pointer and this triggered a compiler
index 2061683daf1f94a9fb01b2d1bff6e892847875b3..c4e9c2cb25c49db1a0536a627d66f961f20dc594 100644 (file)
@@ -37,5 +37,6 @@ advice from friends like these:
  Yang Tse, Daniel Fandrich, Kamil Dudka, Caolan McNamara, Frank McGeough,
  Andre Guibert de Bruet, Mike Crowe, Claes Jakobsson, John E. Malmberg,
  Aaron Oneal, Igor Novoseltsev, Eric Wong, Bill Hoffman, Daniel Steinberg,
+ Fabian Keil
 
         Thanks! (and sorry if I forgot to mention someone)
index 241f7ff3fb8383a9115a2f1f4085f996bef29b88..32ea705e484f082cedfc62568365d31370f01f28 100644 (file)
@@ -405,7 +405,7 @@ Curl_cookie_add(struct SessionHandle *data,
       }
 
       ptr=semiptr+1;
-      while(ptr && *ptr && ISBLANK(*ptr))
+      while(*ptr && ISBLANK(*ptr))
         ptr++;
       semiptr=strchr(ptr, ';'); /* now, find the next semicolon */
 
index acf7ef68954cfd148c1bc82203bcdf435936c0e6..223eddc0e3371575e5c017dd2cf55061ae7f6e07 100644 (file)
@@ -182,7 +182,7 @@ static CURLcode dict_do(struct connectdata *conn, bool *done)
           *strategy++ = (char)0;
           nthdef = strchr(strategy, ':');
           if(nthdef) {
-            *nthdef++ = (char)0;
+            *nthdef = (char)0;
           }
         }
       }
@@ -238,7 +238,7 @@ static CURLcode dict_do(struct connectdata *conn, bool *done)
         *database++ = (char)0;
         nthdef = strchr(database, ':');
         if(nthdef) {
-          *nthdef++ = (char)0;
+          *nthdef = (char)0;
         }
       }
     }
index ccbec227fe5f2abcd421c6c2b309bf85faa78393..8457b51f44dbf666e145ffebfcf219f723afa8c1 100644 (file)
@@ -1417,10 +1417,9 @@ CURLcode Curl_proxyCONNECT(struct connectdata *conn,
     /* if timeout is requested, find out how much remaining time we have */
     check = timeout - /* timeout time */
       Curl_tvdiff(Curl_tvnow(), conn->now); /* spent time */
-    if(check <=) {
+    if(check <= 0) {
       failf(data, "Proxy CONNECT aborted due to timeout");
-      error = SELECT_TIMEOUT; /* already too little time */
-      break;
+      return CURLE_RECV_ERROR;
     }
 
     /* if we're in multi-mode and we would block, return instead for a retry */
index 13ef3cff66b11feda3289ebcd7aacf5b97f83463..ee35d66032649470be6ec9e56eb5d841d6d128ce 100644 (file)
@@ -345,7 +345,6 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn,
         conn->trailer[conn->trlPos]=0;
         if(conn->trlPos==2) {
           ch->state = CHUNK_STOP;
-          datap++;
           length--;
 
           /*
@@ -400,7 +399,6 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn,
 
     case CHUNK_STOP:
       if(*datap == 0x0a) {
-        datap++;
         length--;
 
         /* Record the length of any data left in the end of the buffer
index 0f8ccd33bf9b65ca41b33889deebefd2bb0261bc..e80da04c707fdbdd9b061562fcd9ff5ed3355755 100644 (file)
@@ -133,12 +133,11 @@ static size_t convert_lineends(struct SessionHandle *data,
         *outPtr = *inPtr;
       }
       outPtr++;
-      inPtr++;
     }
-    if(outPtr < startPtr+size) {
+    if(outPtr < startPtr+size)
       /* tidy up by null terminating the now shorter data */
       *outPtr = '\0';
-    }
+
     return(outPtr - startPtr);
   }
   return(size);
index 90bdfc26213e8c7c2e550605a961bb05f9ef1390..a570f71630b2a8fb241fb52df607d4640405dd70 100644 (file)
@@ -857,7 +857,6 @@ int Curl_ossl_shutdown(struct connectdata *conn, int sockindex)
         /* timeout */
         failf(data, "SSL shutdown timeout");
         done = 1;
-        break;
       }
       else {
         /* anything that gets here is fatally bad */
@@ -2272,7 +2271,6 @@ ossl_connect_common(struct connectdata *conn,
       return retcode;
   }
 
-  timeout_ms = 0;
   while(ssl_connect_2 == connssl->connecting_state ||
         ssl_connect_2_reading == connssl->connecting_state ||
         ssl_connect_2_writing == connssl->connecting_state) {
index 0337ea8674edbb6dbbbbeca6971e7e766e924dc4..1ef52e8ecdae4cc118a150d4e1c34373c6a880ed 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -3489,7 +3489,6 @@ static bool check_noproxy(const char* name, const char* no_proxy)
     else
       namelen = strlen(name);
 
-    tok_start = 0;
     for (tok_start = 0; tok_start < no_proxy_len; tok_start = tok_end + 1) {
       while (tok_start < no_proxy_len &&
              strchr(separator, no_proxy[tok_start]) != NULL) {
index 46cdb4eb2fbbc8d561d448f6a45da184707689c7..663b7e32b9d0b62c38ae80c5ddfa2f631d5e2437 100644 (file)
@@ -2702,7 +2702,6 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
       break;
     case 'Q':
       /* QUOTE command to send to FTP server */
-      err = PARAM_OK;
       switch(nextarg[0]) {
       case '-':
         /* prefixed with a dash makes it a POST TRANSFER one */
@@ -3382,7 +3381,6 @@ static int myprogress (void *clientp,
     percent = frac * 100.0f;
     barwidth = bar->width - 7;
     num = (int) (((double)barwidth) * frac);
-    i = 0;
     for ( i = 0; i < num; i++ ) {
       line[i] = '#';
     }