aboutsummaryrefslogtreecommitdiff
path: root/stdlib
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-01-20 02:01:32 +0000
committerUlrich Drepper <drepper@redhat.com>2000-01-20 02:01:32 +0000
commit0e179ea6dddaf0cf65f1d08f68cbfecc05f37a19 (patch)
treef07cf53a16367d45779f1e523d0063e8e0353b3e /stdlib
parentdbfdf94429eec0dcf065f1abcc31a08799cf140f (diff)
downloadglibc-0e179ea6dddaf0cf65f1d08f68cbfecc05f37a19.tar
glibc-0e179ea6dddaf0cf65f1d08f68cbfecc05f37a19.tar.gz
glibc-0e179ea6dddaf0cf65f1d08f68cbfecc05f37a19.tar.bz2
glibc-0e179ea6dddaf0cf65f1d08f68cbfecc05f37a19.zip
Update.
* stdlib/strfmon.c: Don't report an error if final NUL is at the end of the buffer. Set errno correctly if floating-point number would overflow buffer. * posix/regex.h: Update comment of RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/strfmon.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/stdlib/strfmon.c b/stdlib/strfmon.c
index 7041994eca..ac6b8b6c93 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, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998, 1999, 2000 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.
@@ -465,7 +465,10 @@ __strfmon_l (char *s, size_t maxsize, __locale_t loc, const char *format, ...)
}
if (s[maxsize - 1] != '\0')
- return -1;
+ {
+ __set_errno (E2BIG);
+ return -1;
+ }
dest += done;
@@ -521,9 +524,9 @@ __strfmon_l (char *s, size_t maxsize, __locale_t loc, const char *format, ...)
}
/* Terminate the string. */
- out_char ('\0');
+ *dest = '\0';
va_end (ap);
- return dest - s - 1;
+ return dest - s;
}