diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-10-22 23:27:25 -0500 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-10-23 00:27:25 -0400 |
commit | 30776485c5bc2d9c356e875f2aee874d22c393b7 (patch) | |
tree | 4be0f15f2b7871b7b8a987534fbb6b2b257f078e /src/journal-remote | |
parent | d71839afd88589247d8dd42b2b09d024f521749d (diff) |
journal-upload: avoid calling printf with maximum precision
Precision of INT_MAX does not work as I expected it to.
https://bugzilla.redhat.com/show_bug.cgi?id=1154334
Diffstat (limited to 'src/journal-remote')
-rw-r--r-- | src/journal-remote/journal-upload.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/journal-remote/journal-upload.c b/src/journal-remote/journal-upload.c index 37c12f0e07..229bceeb80 100644 --- a/src/journal-remote/journal-upload.c +++ b/src/journal-remote/journal-upload.c @@ -496,10 +496,12 @@ static int perform_upload(Uploader *u) { code = curl_easy_perform(u->easy); if (code) { - log_error("Upload to %s failed: %.*s", - u->url, - u->error[0] ? (int) sizeof(u->error) : INT_MAX, - u->error[0] ? u->error : curl_easy_strerror(code)); + if (u->error[0]) + log_error("Upload to %s failed: %.*s", + u->url, (int) sizeof(u->error), u->error); + else + log_error("Upload to %s failed: %s", + u->url, curl_easy_strerror(code)); return -EIO; } |