printf: fix format specifiers

Closes #3426
This commit is contained in:
Rikard Falkeborn 2018-09-16 22:04:49 +02:00 committed by Daniel Stenberg
parent c7c362a24c
commit fa2d6ba84d
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
7 changed files with 19 additions and 20 deletions

View file

@ -1396,7 +1396,7 @@ static int _strlen_check(int linenumber, char *buf, size_t len)
size_t buflen = strlen(buf);
if(len != buflen) {
/* they shouldn't differ */
printf("sprintf strlen:%d failed:\nwe '%d'\nsystem: '%d'\n",
printf("sprintf strlen:%d failed:\nwe '%zu'\nsystem: '%zu'\n",
linenumber, buflen, len);
return 1;
}

View file

@ -160,13 +160,13 @@ UNITTEST_START
int rc = doh_encode(req[i].name, req[i].type,
buffer, sizeof(buffer), &size);
if(rc != req[i].rc) {
fprintf(stderr, "req %d: Expected return code %d got %d\n", i,
fprintf(stderr, "req %zu: Expected return code %d got %d\n", i,
req[i].rc, rc);
return 1;
}
else if(size != req[i].size) {
fprintf(stderr, "req %d: Expected size %d got %d\n", i,
(int)req[i].size, (int)size);
fprintf(stderr, "req %zu: Expected size %zu got %zu\n", i,
req[i].size, size);
fprintf(stderr, "DNS encode made: %s\n", hexdump(buffer, size));
return 2;
}
@ -188,7 +188,7 @@ UNITTEST_START
rc = doh_decode((unsigned char *)resp[i].packet, resp[i].size,
resp[i].type, &d);
if(rc != resp[i].rc) {
fprintf(stderr, "resp %d: Expected return code %d got %d\n", i,
fprintf(stderr, "resp %zu: Expected return code %d got %d\n", i,
resp[i].rc, rc);
return 4;
}
@ -229,7 +229,7 @@ UNITTEST_START
}
de_cleanup(&d);
if(resp[i].out && strcmp((char *)buffer, resp[i].out)) {
fprintf(stderr, "resp %d: Expected %s got %s\n", i,
fprintf(stderr, "resp %zu: Expected %s got %s\n", i,
resp[i].out, buffer);
return 1;
}
@ -244,7 +244,7 @@ UNITTEST_START
rc = doh_decode((unsigned char *)full49, i, DNS_TYPE_A, &d);
if(!rc) {
/* none of them should work */
fprintf(stderr, "%d: %d\n", i, rc);
fprintf(stderr, "%zu: %d\n", i, rc);
return 5;
}
}
@ -257,7 +257,7 @@ UNITTEST_START
DNS_TYPE_A, &d);
if(!rc) {
/* none of them should work */
fprintf(stderr, "2 %d: %d\n", i, rc);
fprintf(stderr, "2 %zu: %d\n", i, rc);
return 7;
}
}