From: Marcel Raad Date: Sat, 6 Feb 2021 09:26:38 +0000 (+0100) Subject: ftp: fix Codacy/cppcheck warning about null pointer arithmetic X-Git-Tag: curl-7_76_0~181 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a3f93a62a2f53ea0f8b88cedefdaa4ee1bc4baea;p=thirdparty%2Fcurl.git ftp: fix Codacy/cppcheck warning about null pointer arithmetic Increment `bytes` only if it is non-null. Closes https://github.com/curl/curl/pull/6576 --- diff --git a/lib/ftp.c b/lib/ftp.c index f0ce14c13d..56e7cf29ef 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -2482,7 +2482,8 @@ static CURLcode ftp_state_get_resp(struct Curl_easy *data, bytes--; } /* if we have nothing but digits: */ - if(bytes++) { + if(bytes) { + ++bytes; /* get the number! */ (void)curlx_strtoofft(bytes, NULL, 0, &size); }