diff options
author | Ulrich Drepper <drepper@redhat.com> | 1997-08-05 23:36:21 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1997-08-05 23:36:21 +0000 |
commit | 044b16f4e9ae773187f4fee8a9a0a54f9a51f13f (patch) | |
tree | 58bc41e16535e0d0f61d51e6af15ce4128864fc9 /stdlib | |
parent | c59a94711c6a9d38811b828863076f39000831b4 (diff) | |
download | glibc-044b16f4e9ae773187f4fee8a9a0a54f9a51f13f.tar glibc-044b16f4e9ae773187f4fee8a9a0a54f9a51f13f.tar.gz glibc-044b16f4e9ae773187f4fee8a9a0a54f9a51f13f.tar.bz2 glibc-044b16f4e9ae773187f4fee8a9a0a54f9a51f13f.zip |
update for 2.0.5pre1
Diffstat (limited to 'stdlib')
-rw-r--r-- | stdlib/strfmon.c | 9 | ||||
-rw-r--r-- | stdlib/tst-strtol.c | 3 |
2 files changed, 10 insertions, 2 deletions
diff --git a/stdlib/strfmon.c b/stdlib/strfmon.c index 469908c1df..9ca4fe0361 100644 --- a/stdlib/strfmon.c +++ b/stdlib/strfmon.c @@ -1,5 +1,5 @@ /* Formatting a monetary value according to the current locale. - Copyright (C) 1996 Free Software Foundation, Inc. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com> and Jochen Hein <Jochen.Hein@informatik.TU-Clausthal.de>, 1996. @@ -151,6 +151,13 @@ strfmon (char *s, size_t maxsize, const char *format, ...) { case '=': /* Set fill character. */ pad = *++fmt; + if (pad == '\0') + { + /* Premature EOS. */ + __set_errno (EINVAL); + va_end (ap); + return -1; + } continue; case '^': /* Don't group digits. */ group = 0; diff --git a/stdlib/tst-strtol.c b/stdlib/tst-strtol.c index 8719d4b9ed..62acafbfe3 100644 --- a/stdlib/tst-strtol.c +++ b/stdlib/tst-strtol.c @@ -6,6 +6,7 @@ #include <errno.h> #include <stdlib.h> #include <strings.h> +#include <limits.h> struct ltest { @@ -17,7 +18,7 @@ struct ltest }; static const struct ltest tests[] = { -#if ~0UL == 0xffffffff +#if LONG_MAX == 0x7fffffff /* First, signed numbers. */ { " -17", -17, 0, 0, 0 }, { " +0x123fg", 0x123f, 0, 'g', 0 }, |