From: Marcel Raad Date: Sun, 7 Feb 2021 08:29:59 +0000 (+0100) Subject: lib: remove redundant code X-Git-Tag: curl-7_76_0~176 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1cd823ed5ab590636fab218741dbf0a61f1d3157;p=thirdparty%2Fcurl.git lib: remove redundant code Closes https://github.com/curl/curl/pull/6576 --- diff --git a/lib/ftplistparser.c b/lib/ftplistparser.c index d3720b1f10..81825e6ff6 100644 --- a/lib/ftplistparser.c +++ b/lib/ftplistparser.c @@ -966,7 +966,6 @@ size_t Curl_ftp_parselist(char *buffer, size_t size, size_t nmemb, else if(c == '\n') { parser->offsets.filename = parser->item_offset; finfo->b_data[finfo->b_used - 1] = 0; - parser->offsets.filename = parser->item_offset; result = ftp_pl_insert_finfo(data, infop); if(result) { parser->error = result; diff --git a/lib/memdebug.c b/lib/memdebug.c index 881ee85c32..0aba6ef6ba 100644 --- a/lib/memdebug.c +++ b/lib/memdebug.c @@ -91,15 +91,13 @@ static bool countcheck(const char *func, int line, const char *source) should not be made */ if(memlimit && source) { if(!memsize) { - if(source) { - /* log to file */ - curl_dbg_log("LIMIT %s:%d %s reached memlimit\n", - source, line, func); - /* log to stderr also */ - fprintf(stderr, "LIMIT %s:%d %s reached memlimit\n", - source, line, func); - fflush(curl_dbg_logfile); /* because it might crash now */ - } + /* log to file */ + curl_dbg_log("LIMIT %s:%d %s reached memlimit\n", + source, line, func); + /* log to stderr also */ + fprintf(stderr, "LIMIT %s:%d %s reached memlimit\n", + source, line, func); + fflush(curl_dbg_logfile); /* because it might crash now */ errno = ENOMEM; return TRUE; /* RETURN ERROR! */ } diff --git a/lib/sendf.c b/lib/sendf.c index b3c7fe33d3..b57b7878c2 100644 --- a/lib/sendf.c +++ b/lib/sendf.c @@ -498,9 +498,7 @@ static CURLcode pausewrite(struct Curl_easy *data, /* store this information in the state struct for later use */ Curl_dyn_init(&s->tempwrite[i].b, DYN_PAUSE_BUFFER); s->tempwrite[i].type = type; - - if(newtype) - s->tempcount++; + s->tempcount++; } if(Curl_dyn_addn(&s->tempwrite[i].b, (unsigned char *)ptr, len)) diff --git a/lib/tftp.c b/lib/tftp.c index defc9105e0..a85f297a75 100644 --- a/lib/tftp.c +++ b/lib/tftp.c @@ -231,12 +231,6 @@ static CURLcode tftp_set_timeouts(struct tftp_state_data *state) if(state->retry_max < 1) /* avoid division by zero below */ state->retry_max = 1; - - /* Compute the re-start interval to suit the timeout */ - state->retry_time = (int)timeout/state->retry_max; - if(state->retry_time<1) - state->retry_time = 1; - } else { if(timeout_ms > 0) diff --git a/lib/vquic/ngtcp2.c b/lib/vquic/ngtcp2.c index 834b643148..ffc5b1076f 100644 --- a/lib/vquic/ngtcp2.c +++ b/lib/vquic/ngtcp2.c @@ -1788,7 +1788,6 @@ static CURLcode ng_flush_egress(struct Curl_easy *data, ngtcp2_path_storage_zero(&ps); for(;;) { - outlen = -1; veccnt = 0; stream_id = -1; fin = 0; diff --git a/lib/vtls/gskit.c b/lib/vtls/gskit.c index ac2b805b76..60ac8ae7da 100644 --- a/lib/vtls/gskit.c +++ b/lib/vtls/gskit.c @@ -700,7 +700,6 @@ static CURLcode gskit_connect_step1(struct Curl_easy *data, struct ssl_connect_data *connssl = &conn->ssl[sockindex]; gsk_handle envir; CURLcode result; - int rc; const char * const keyringfile = SSL_CONN_CONFIG(CAfile); const char * const keyringpwd = SSL_SET_OPTION(key_passwd); const char * const keyringlabel = SSL_SET_OPTION(primary.clientcert);