aboutsummaryrefslogtreecommitdiff
path: root/misc/tst-efgcvt.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-06-23 12:38:51 +0000
committerUlrich Drepper <drepper@redhat.com>1999-06-23 12:38:51 +0000
commit67994d6f6010739c22b1b4ab99aa88b4fe1ab8bd (patch)
tree4e1bea455bb81a13bad448cacbb5582e1f6f78f4 /misc/tst-efgcvt.c
parent7df789e05906a883d03ed2cb2c400356350767cc (diff)
downloadglibc-67994d6f6010739c22b1b4ab99aa88b4fe1ab8bd.zip
glibc-67994d6f6010739c22b1b4ab99aa88b4fe1ab8bd.tar.gz
glibc-67994d6f6010739c22b1b4ab99aa88b4fe1ab8bd.tar.bz2
Update.
1999-06-23 Ulrich Drepper <drepper@cygnus.com> * manual/arith.texi: Document restriction of ndigit parameter of ecvt and friends. * misc/efgcvt.c: Define NDIGIT_MAX. (gcvt): Limit precision in sprintf call to NDIGIT_MAX. Do not dynamically allocate the static buffers. They are small enough. * misc/efgcvt_r.c: Define NDIGIT_MAX. (fcvt_r): Limit precision in snprintf call to NDIGIT_MAX. * misc/qefgcvt.c: Define NDIGIT_MAX. * misc/qefgcvt_r.c: Likewise. * misc/tst-efgcvt.c (special): Add test for large ndigit parameter.
Diffstat (limited to 'misc/tst-efgcvt.c')
-rw-r--r--misc/tst-efgcvt.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/misc/tst-efgcvt.c b/misc/tst-efgcvt.c
index 780dd9a..cfbaa21 100644
--- a/misc/tst-efgcvt.c
+++ b/misc/tst-efgcvt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 1999 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -131,6 +131,10 @@ special (void)
if (sign != 0 || strcmp (p, "inf") != 0)
output_error ("ecvt", NAN, 10, "inf", 0, 0, p, decpt, sign);
+ /* Simply make sure these calls with large NDIGITs don't crash. */
+ (void) ecvt (123.456, 10000, &decpt, &sign);
+ (void) fcvt (123.456, 10000, &decpt, &sign);
+
}