1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-16 06:25:03 -05:00

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
This commit is contained in:
Marcel Raad 2021-02-06 10:26:38 +01:00
parent ec5d9b44a2
commit a3f93a62a2
No known key found for this signature in database
GPG Key ID: 33C416EFAE4D6F02

View File

@ -2482,7 +2482,8 @@ static CURLcode ftp_state_get_resp(struct Curl_easy *data,
bytes--; bytes--;
} }
/* if we have nothing but digits: */ /* if we have nothing but digits: */
if(bytes++) { if(bytes) {
++bytes;
/* get the number! */ /* get the number! */
(void)curlx_strtoofft(bytes, NULL, 0, &size); (void)curlx_strtoofft(bytes, NULL, 0, &size);
} }