Module Name: src
Committed By: bouyer
Date: Sat Mar 17 17:49:55 UTC 2012
Modified Files:
src/tests/lib/libc/gen [netbsd-6]: t_humanize_number.c
src/tests/lib/libc/stdio [netbsd-6]: t_printf.c t_scanf.c
Log Message:
Pull up following revision(s) (requested by joerg in ticket #119):
tests/lib/libc/stdio/t_printf.c: revision 1.5
tests/lib/libc/stdio/t_scanf.c: revision 1.2
tests/lib/libc/gen/t_humanize_number.c: revision 1.6
Mark w_printf as __printflike and fix a format string error.
Fix format strings to properly quote %.
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.5.4.1 src/tests/lib/libc/gen/t_humanize_number.c
cvs rdiff -u -r1.2 -r1.2.4.1 src/tests/lib/libc/stdio/t_printf.c
cvs rdiff -u -r1.1 -r1.1.4.1 src/tests/lib/libc/stdio/t_scanf.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/lib/libc/gen/t_humanize_number.c
diff -u src/tests/lib/libc/gen/t_humanize_number.c:1.5 src/tests/lib/libc/gen/t_humanize_number.c:1.5.4.1
--- src/tests/lib/libc/gen/t_humanize_number.c:1.5 Thu Jul 7 09:49:59 2011
+++ src/tests/lib/libc/gen/t_humanize_number.c Sat Mar 17 17:49:55 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: t_humanize_number.c,v 1.5 2011/07/07 09:49:59 jruoho Exp $ */
+/* $NetBSD: t_humanize_number.c,v 1.5.4.1 2012/03/17 17:49:55 bouyer Exp $ */
/*-
* Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
@@ -112,7 +112,7 @@ const struct hnflags normal_flags[] = {
const char *formatflags(char *, size_t, const struct hnflags *, size_t, int);
void newline(void);
-void w_printf(const char *, ...);
+void w_printf(const char *, ...) __printflike(1, 2);
int main(int, char *[]);
const char *
@@ -226,7 +226,7 @@ ATF_TC_BODY(humanize_number_basic, tc)
(rv == -1 || strcmp(buf, ho->ho_retstr) == 0))
continue;
- w_printf("humanize_number(\"%s\", %d, %" PRId64 ",",
+ w_printf("humanize_number(\"%s\", %zu, %" PRId64 ",",
ho->ho_retstr, ho->ho_len, ho->ho_num);
w_printf("\"%s\",", ho->ho_suffix);
w_printf("%s,", formatflags(fbuf, sizeof(fbuf), scale_flags,
Index: src/tests/lib/libc/stdio/t_printf.c
diff -u src/tests/lib/libc/stdio/t_printf.c:1.2 src/tests/lib/libc/stdio/t_printf.c:1.2.4.1
--- src/tests/lib/libc/stdio/t_printf.c:1.2 Wed Jul 13 11:17:03 2011
+++ src/tests/lib/libc/stdio/t_printf.c Sat Mar 17 17:49:55 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: t_printf.c,v 1.2 2011/07/13 11:17:03 jruoho Exp $ */
+/* $NetBSD: t_printf.c,v 1.2.4.1 2012/03/17 17:49:55 bouyer Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@ ATF_TC_HEAD(snprintf_dotzero, tc)
{
atf_tc_set_md_var(tc, "descr", \
- "PR lib/32951: %.0f formats (0.0,0.5] to \"0.\"");
+ "PR lib/32951: %%.0f formats (0.0,0.5] to \"0.\"");
}
ATF_TC_BODY(snprintf_dotzero, tc)
Index: src/tests/lib/libc/stdio/t_scanf.c
diff -u src/tests/lib/libc/stdio/t_scanf.c:1.1 src/tests/lib/libc/stdio/t_scanf.c:1.1.4.1
--- src/tests/lib/libc/stdio/t_scanf.c:1.1 Fri Jul 8 06:38:04 2011
+++ src/tests/lib/libc/stdio/t_scanf.c Sat Mar 17 17:49:55 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: t_scanf.c,v 1.1 2011/07/08 06:38:04 jruoho Exp $ */
+/* $NetBSD: t_scanf.c,v 1.1.4.1 2012/03/17 17:49:55 bouyer Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@ ATF_TC_HEAD(sscanf_neghex, tc)
{
atf_tc_set_md_var(tc, "descr", \
- "PR lib/21691: %i and %x fail with negative hex numbers");
+ "PR lib/21691: %%i and %%x fail with negative hex numbers");
}
ATF_TC_BODY(sscanf_neghex, tc)