mirror of
https://github.com/libssh2/libssh2.git
synced 2025-08-05 20:55:47 +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:
@@ -199,9 +199,9 @@ int main(int argc, char *argv[])
|
||||
;
|
||||
}
|
||||
ptr += rc;
|
||||
nread -= nread;
|
||||
} while (rc > 0);
|
||||
} while (1);
|
||||
nread -= rc;
|
||||
} while (nread);
|
||||
} while (rc > 0);
|
||||
|
||||
fclose(local);
|
||||
libssh2_sftp_close(sftp_handle);
|
||||
|
Reference in New Issue
Block a user