aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-05-01 18:35:44 +0000
committerUlrich Drepper <drepper@redhat.com>2007-05-01 18:35:44 +0000
commit1cb04337f2f373b5ebc6a83d254add05f850ebe1 (patch)
treea34141fe2a53623b6c202818da51e06538206811
parentc01c245517b43fa3b983168197e7d05eef5f9828 (diff)
downloadglibc-1cb04337f2f373b5ebc6a83d254add05f850ebe1.zip
glibc-1cb04337f2f373b5ebc6a83d254add05f850ebe1.tar.gz
glibc-1cb04337f2f373b5ebc6a83d254add05f850ebe1.tar.bz2
* stdio-common/test-vfprintf.c (main): Add test for large
precision.
-rw-r--r--ChangeLog2
-rw-r--r--stdio-common/test-vfprintf.c8
2 files changed, 7 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 6ba3a12..d558ded 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,8 @@
[BZ #4438]
* stdio-common/vfprintf.c (process_string_arg): Don't overflow the
stack for large precisions.
+ * stdio-common/test-vfprintf.c (main): Add test for large
+ precision.
2007-04-30 Jakub Jelinek <jakub@redhat.com>
diff --git a/stdio-common/test-vfprintf.c b/stdio-common/test-vfprintf.c
index a683eac..342ac47 100644
--- a/stdio-common/test-vfprintf.c
+++ b/stdio-common/test-vfprintf.c
@@ -1,5 +1,5 @@
/* Tests of *printf for very large strings.
- Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2002, 2003, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2000.
@@ -94,6 +94,7 @@ main (void)
fprintf (fp, "%.*s", 30000, large);
large[20000] = '\0';
fprintf (fp, large);
+ fprintf (fp, "%-1.300000000s", "hello");
if (fflush (fp) != 0 || ferror (fp) != 0 || fclose (fp) != 0)
{
@@ -108,11 +109,12 @@ main (void)
setlocale (LC_ALL, NULL));
exit (1);
}
- else if (st.st_size != 99999)
+ else if (st.st_size != 50000 + 30000 + 19999 + 5)
{
printf ("file size incorrect for locale %s: %jd instead of %jd\n",
setlocale (LC_ALL, NULL),
- (intmax_t) st.st_size, (intmax_t) 99999);
+ (intmax_t) st.st_size,
+ (intmax_t) 50000 + 30000 + 19999 + 5);
res = 1;
}
else