Skip to content

Commit

Permalink
ftp: fix Codacy/cppcheck warning about null pointer arithmetic
Browse files Browse the repository at this point in the history
Increment `bytes` only if it is non-null.

Closes #6576
  • Loading branch information
MarcelRaad committed Feb 10, 2021
1 parent ec5d9b4 commit a3f93a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/ftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit a3f93a6

Please sign in to comment.