mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-15 07:30:13 +00:00
69c69fe11d
2000-07-28 Ulrich Drepper <drepper@redhat.com> * stdio-common/_i18n_itoa.c: Removed. * stdio-common/_i18n_itoa.h: Removed. * stdio-common/_i18n_itowa.c: Removed. * stdio-common/_i18n_itowa.h: Removed. * stdio-common/_i18n_number.h: New file. * stdio-common/Depend: New file. * stdio-common/printf-parse.h: Handle I modifier correctly. Optimize. * stdio-common/vfprintf.c: Rewrite buffer handling for integer printing. Change printing of numbers with locale specific digits to use new code in _i18n_number.h. * stdio-common/bug13.c: Improve messages. * locale/programs/ld-ctype.c (ctype_read): Improve error message. (set_class_defaults): Always search also for Uxxxx names. Detect insufficient number of outdigits. * locale/Makefile (C-translit.h): Use mv not $(move-if-changed).
31 lines
584 B
C
31 lines
584 B
C
#include <stdio.h>
|
|
|
|
|
|
|
|
int
|
|
main (void)
|
|
{
|
|
int res = 0;
|
|
char buf[100];
|
|
|
|
#define TEST(nr, result, format, args...) \
|
|
if (sprintf (buf, format, ## args) != result) \
|
|
{ \
|
|
printf ("test %d failed (\"%s\", %d)\n", nr, buf, result); \
|
|
res = 1; \
|
|
}
|
|
|
|
TEST (1, 2, "%d", -1);
|
|
TEST (2, 2, "% 2d", 1);
|
|
TEST (3, 3, "%#x", 1);
|
|
TEST (4, 2, "%+d", 1);
|
|
TEST (5, 2, "% d", 1);
|
|
TEST (6, 2, "%-d", -1);
|
|
TEST (7, 2, "%- 2d", 1);
|
|
TEST (8, 3, "%-#x", 1);
|
|
TEST (9, 2, "%-+d", 1);
|
|
TEST (10, 2, "%- d", 1);
|
|
|
|
return res;
|
|
}
|