Fixed cppcheck error on osx

This commit is contained in:
Takeshi Nakatani 2018-02-28 12:29:58 +00:00
parent c494e54320
commit be9d407fa0

View File

@ -1618,12 +1618,15 @@ int S3fsCurl::CurlDebugFunc(CURL* hcurl, curl_infotype type, char* data, size_t
break; break;
case CURLINFO_HEADER_IN: case CURLINFO_HEADER_IN:
case CURLINFO_HEADER_OUT: case CURLINFO_HEADER_OUT:
size_t remaining;
char* p;
// Print each line individually for tidy output // Print each line individually for tidy output
size_t remaining = size; remaining = size;
char* p = data; p = data;
do { do {
char* eol = (char*)memchr(p, '\n', remaining); char* eol = (char*)memchr(p, '\n', remaining);
int newline = 0; int newline = 0;
if (eol == NULL) { if (eol == NULL) {
eol = (char*)memchr(p, '\r', remaining); eol = (char*)memchr(p, '\r', remaining);
} else if (eol > p && *(eol - 1) == '\r') { } else if (eol > p && *(eol - 1) == '\r') {