]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Tue, 28 Nov 2000 21:12:43 +0000 (21:12 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 28 Nov 2000 21:12:43 +0000 (21:12 +0000)
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.

ChangeLog
sysdeps/generic/bsd-_setjmp.c
time/strftime.c

index 88de3eb4306fb1be47c028f4dad3e78b9d823795..e5c71d49657ddbc2a1088737eb2a55f562be4d44 100644 (file)
--- 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
index eba899003ac406697540bd04a33ed6c542af3868..0e3f9a54a080cd5e868e68cab462bc4146a293e8 100644 (file)
@@ -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
index f98fe21079b3eb2fd2bd62a9a703757efcdb8f6c..2f99143771aa3307c63bf3318beff31ab03423f0 100644 (file)
@@ -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;