summaryrefslogtreecommitdiff
path: root/stdlib/strfmon.c
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/strfmon.c')
-rw-r--r--stdlib/strfmon.c9
1 files changed, 8 insertions, 1 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;