1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-07-02 22:02:25 +03:00

examples: use stderr for messages, stdout for data

Reported by: Karel Srot
Bug: https://bugzilla.redhat.com/867462
This commit is contained in:
Kamil Dudka
2012-10-22 13:29:27 +02:00
parent e2bb780d77
commit b31e35aba6
20 changed files with 148 additions and 141 deletions

View File

@ -134,11 +134,11 @@ int main(int argc, char *argv[])
* user, that's your call
*/
fingerprint = libssh2_hostkey_hash(session, LIBSSH2_HOSTKEY_HASH_SHA1);
printf("Fingerprint: ");
fprintf(stderr, "Fingerprint: ");
for(i = 0; i < 20; i++) {
printf("%02X ", (unsigned char)fingerprint[i]);
fprintf(stderr, "%02X ", (unsigned char)fingerprint[i]);
}
printf("\n");
fprintf(stderr, "\n");
if (auth_pw) {
/* We could authenticate via password */
@ -239,7 +239,7 @@ int main(int argc, char *argv[])
#else
close(sock);
#endif
printf("all done\n");
fprintf(stderr, "all done\n");
libssh2_exit();