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
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2014-10-23 00:27:25 -04:00
parent d71839afd8
commit 30776485c5
+6 -4
View File
@@ -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;
}