aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--sysdeps/generic/bsd-_setjmp.c6
-rw-r--r--time/strftime.c10
3 files changed, 17 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 88de3eb..e5c71d4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2000-11-22 Paul Eggert <eggert@twinsun.com>
+
+ * time/strftime.c (my_strftime): Do not invoke mbrlen with a
+ size of (size_t) -1; it's not portable.
+
2000-11-28 Ulrich Drepper <drepper@redhat.com>
* sysdeps/i386/fpu/libm-test-ulps: Adjust some values for the
diff --git a/sysdeps/generic/bsd-_setjmp.c b/sysdeps/generic/bsd-_setjmp.c
index eba8990..0e3f9a5 100644
--- a/sysdeps/generic/bsd-_setjmp.c
+++ b/sysdeps/generic/bsd-_setjmp.c
@@ -1,5 +1,5 @@
-/* BSD `setjmp' entry point to `sigsetjmp (..., 0)'. Stub version.
- Copyright (C) 1994, 1997, 1999 Free Software Foundation, Inc.
+/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. Stub version.
+ Copyright (C) 1994, 1997, 1999, 2000 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
@@ -20,7 +20,7 @@
#include <sysdep.h>
#include <setjmp.h>
-#undef setjmp
+#undef _setjmp
/* This implementation in C will not usually work, because the call
really needs to be a tail-call so __sigsetjmp saves the state of
diff --git a/time/strftime.c b/time/strftime.c
index f98fe21..2f99143 100644
--- a/time/strftime.c
+++ b/time/strftime.c
@@ -513,6 +513,9 @@ my_strftime (s, maxsize, format, tp ut_argument)
size_t i = 0;
CHAR_T *p = s;
const CHAR_T *f;
+#if DO_MULTIBYTE && !defined COMPILE_WIDE
+ const char *format_end = NULL;
+#endif
zone = NULL;
#if HAVE_TM_ZONE
@@ -605,10 +608,15 @@ my_strftime (s, maxsize, format, tp ut_argument)
{
mbstate_t mbstate = mbstate_zero;
size_t len = 0;
+ size_t fsize;
+
+ if (! format_end)
+ format_end = f + strlen (f) + 1;
+ fsize = format_end - f;
do
{
- size_t bytes = mbrlen (f + len, (size_t) -1, &mbstate);
+ size_t bytes = mbrlen (f + len, fsize - len, &mbstate);
if (bytes == 0)
break;