telnet: (win32) fix read callback return variable

telnet.c(1427,21): warning: comparison of constant 268435456 with
expression of type 'CURLcode' is always false

telnet.c(1433,21): warning: comparison of constant 268435457 with
expression of type 'CURLcode' is always false

Reviewed-by: Jay Satiro
Reported-by: Gisle Vanem
Bug: https://github.com/curl/curl/issues/1225#issuecomment-290340890

Closes #1374
This commit is contained in:
Daniel Stenberg 2017-03-31 14:20:13 +02:00
parent d5d85e7079
commit 76c21ed3fd
1 changed files with 6 additions and 6 deletions

View File

@ -1421,22 +1421,22 @@ static CURLcode telnet_do(struct connectdata *conn, bool *done)
{ {
for(;;) { for(;;) {
if(data->set.is_fread_set) { if(data->set.is_fread_set) {
size_t n;
/* read from user-supplied method */ /* read from user-supplied method */
result = (int)data->state.fread_func(buf, 1, BUFSIZE - 1, n = data->state.fread_func(buf, 1, BUFSIZE - 1, data->state.in);
data->state.in); if(n == CURL_READFUNC_ABORT) {
if(result == CURL_READFUNC_ABORT) {
keepon = FALSE; keepon = FALSE;
result = CURLE_READ_ERROR; result = CURLE_READ_ERROR;
break; break;
} }
if(result == CURL_READFUNC_PAUSE) if(n == CURL_READFUNC_PAUSE)
break; break;
if(result == 0) /* no bytes */ if(n == 0) /* no bytes */
break; break;
readfile_read = result; /* fall thru with number of bytes read */ readfile_read = (DWORD)n; /* fall thru with number of bytes read */
} }
else { else {
/* read from stdin */ /* read from stdin */