mirror of
https://github.com/libssh2/libssh2.git
synced 2025-07-29 13:01:14 +03:00
examples: fixed and made them more similar
The channel read/write functions can return 0 in legitimate cases without it being an error, and we need to loop properly if they return short.
This commit is contained in:
@ -246,7 +246,7 @@ int main(int argc, char *argv[])
|
||||
nread);
|
||||
ptr += rc;
|
||||
nread -= nread;
|
||||
} while (rc > 0);
|
||||
} while (rc >= 0);
|
||||
|
||||
if(rc != LIBSSH2_ERROR_EAGAIN) {
|
||||
/* error or end of file */
|
||||
|
Reference in New Issue
Block a user