Mercurial > hg > octave-nkf > gnulib-hg
changeset 10134:e0015ef1cfee
tests/test-base64.c: Cast size_t to unsigned long when invoking printf. Use %lu instead of %d.
Reported by Bruno Haible <bruno@clisp.org>.
author | Simon Josefsson <simon@josefsson.org> |
---|---|
date | Fri, 30 May 2008 10:35:10 +0200 |
parents | bbccff5988c3 |
children | 4922fa308e5d |
files | ChangeLog tests/test-base64.c |
diffstat | 2 files changed, 13 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-05-30 Simon Josefsson <simon@josefsson.org> + + * tests/test-base64.c: Cast size_t to unsigned long when invoking + printf. Use %lu instead of %d. Reported by Bruno Haible + <bruno@clisp.org>. + 2008-05-29 Eric Blake <ebb9@byu.net> Prefer new POSIX 200x interfaces over futimesat.
--- a/tests/test-base64.c +++ b/tests/test-base64.c @@ -1,5 +1,5 @@ /* Self tests for base64. - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004, 2008 Free Software Foundation, Inc. Written by Simon Josefsson. This program is free software: you can redistribute it and/or modify @@ -118,7 +118,7 @@ if (!ok) fprintf (stderr, "decode failed\n"); if (len != 0) - fprintf (stderr, "failure (%d)\n", len); + fprintf (stderr, "failure (%ul)\n", (unsigned long) len); memset (out, 0x42, sizeof (out)); len = 1; @@ -128,7 +128,7 @@ if (len != 1 || memcmp (out, "abcdefg", 1) != 0) { out[2] = '\0'; - fprintf (stderr, "failure (%d: %s)\n", len, out); + fprintf (stderr, "failure (%ul: %s)\n", (unsigned long) len, out); } memset (out, 0x42, sizeof (out)); @@ -139,7 +139,7 @@ if (len != 2 || memcmp (out, "abcdefg", 2) != 0) { out[3] = '\0'; - fprintf (stderr, "failure (%d: %s)\n", len, out); + fprintf (stderr, "failure (%ul: %s)\n", (unsigned long) len, out); } memset (out, 0x42, sizeof (out)); @@ -150,7 +150,7 @@ if (len != 3 || memcmp (out, "abcdefg", 3) != 0) { out[4] = '\0'; - fprintf (stderr, "failure (%d: %s)\n", len, out); + fprintf (stderr, "failure (%ul: %s)\n", (unsigned long) len, out); } memset (out, 0x42, sizeof (out)); @@ -161,7 +161,7 @@ if (len != 3 || memcmp (out, "abcdefg", 3) != 0) { out[3] = '\0'; - fprintf (stderr, "failure (%d: %s)\n", len, out); + fprintf (stderr, "failure (%ul: %s)\n", (unsigned long) len, out); } memset (out, 0x42, sizeof (out)); @@ -172,7 +172,7 @@ if (len != 7 || memcmp (out, "abcdefg", 7) != 0) { out[7] = '\0'; - fprintf (stderr, "failure (%d: %s)\n", len, out); + fprintf (stderr, "failure (%ul: %s)\n", (unsigned long) len, out); } return 0;