]> git.ozlabs.org Git - ccan/commitdiff
rfc822: Fix test bugs on 64-bit platforms
authorDavid Gibson <david@gibson.dropbear.id.au>
Tue, 14 Aug 2012 03:55:53 +0000 (13:55 +1000)
committerDavid Gibson <david@gibson.dropbear.id.au>
Tue, 14 Aug 2012 03:55:53 +0000 (13:55 +1000)
This fixes some format string related bugs that show up on 64-bit builds.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
ccan/rfc822/test/run-hdr-and-body.c
ccan/rfc822/test/run-unfold.c

index d3f563ff35b95d94f119ef6f2240a40cb8c8f74b..fe4515a3a6768508804bb6021e31555768a223ca 100644 (file)
@@ -45,7 +45,7 @@ static void check_header(struct rfc822_msg *msg,
        allocation_failure_check();
 
        ok(hname.ptr && bytestring_eq(hname, bytestring_from_string(name)),
-          "Header name \"%.*s\"", hname.len, hname.ptr);
+          "Header name \"%.*s\"", (int)hname.len, hname.ptr);
 
        hvalue = rfc822_header_raw_value(msg, h);
        allocation_failure_check();
index b9529269a01e1dbd70b93f7ae26101d47485c179..0f44cd5e30ab4526d08a2e17c6f4c7b32c44e234 100644 (file)
@@ -89,7 +89,7 @@ static void check_folded_header(const char *buf, size_t len)
        hunfold = rfc822_header_unfolded_value(msg, hdr);
        allocation_failure_check();
 
-       ok(hunfold.len == strlen(UNFOLDED), "Unfolded length %d, should be %d",
+       ok(hunfold.len == strlen(UNFOLDED), "Unfolded length %zd, should be %zd",
           hunfold.len, strlen(UNFOLDED));
        ok1(memcmp(hunfold.ptr, UNFOLDED, hunfold.len) == 0);