[haiku-commits] BRANCH HaikuPM-github.package-management [5657c5e] src/system/libroot/posix/glibc/stdio-common

  • From: HaikuPM-github.package-management <community@xxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 21 Aug 2013 18:15:33 +0200 (CEST)

added 1 changeset to branch 'refs/remotes/HaikuPM-github/package-management'
old head: cc91b333bede32fbf9dc43e1f21d609e89b2d3fa
new head: 5657c5eaa59832bf1fa4f1e08e9ed59796ce018f
overview: https://github.com/haiku/HaikuPM/compare/cc91b33...5657c5e

----------------------------------------------------------------------------

5657c5e: Fix #9928: broken printf specifiers "%La" and "%LA"
  
  * fix unitialized variables in __printf_fphex() in case of architectures
    without support for long double - this triggered unreliable results
    or crashes when using %La or %La on x86
  * activate long double implementation in use for x86_64 for x86, too,
    as they share the long double format
  (cherry picked from commit d1716b277cbaf2b4265728d559b819d73330c1ef)

                                    [ Oliver Tappe <zooey@xxxxxxxxxxxxxxx> ]

----------------------------------------------------------------------------

Commit:      5657c5eaa59832bf1fa4f1e08e9ed59796ce018f
Author:      Oliver Tappe <zooey@xxxxxxxxxxxxxxx>
Date:        Wed Aug 21 16:00:13 2013 UTC

Ticket:      https://dev.haiku-os.org/ticket/9928

----------------------------------------------------------------------------

1 file changed, 11 insertions(+), 8 deletions(-)
.../posix/glibc/stdio-common/printf_fphex.c       | 19 +++++++++++--------

----------------------------------------------------------------------------

diff --git a/src/system/libroot/posix/glibc/stdio-common/printf_fphex.c 
b/src/system/libroot/posix/glibc/stdio-common/printf_fphex.c
index 06e0262..271b213 100644
--- a/src/system/libroot/posix/glibc/stdio-common/printf_fphex.c
+++ b/src/system/libroot/posix/glibc/stdio-common/printf_fphex.c
@@ -33,6 +33,9 @@
 /* #define NDEBUG 1*/          /* Undefine this for debugging assertions.  */
 #include <assert.h>
 
+int __printf_fphex (FILE *fp, const struct printf_info *info,
+               const void *const *args);
+
 /* This defines make it possible to use the same code for GNU C library and
    the GNU I/O library.         */
 #ifdef USE_IN_LIBIO
@@ -90,7 +93,7 @@ ssize_t __printf_pad __P ((FILE *, char pad, int n)); /* In 
vfprintf.c.  */
 
 
 
-#ifdef __x86_64__
+#if defined(__x86_64__) || defined(__INTEL__)
 
 /* sysdeps/x86_64/fpu/printf_fphex.c */
 
@@ -166,7 +169,7 @@ do {                                                        
                      \
        }                                                                     \
 } while (0)
 
-#endif /* __x86_64__ */
+#endif /* __x86_64__ || __INTEL__ */
 
 
 int
@@ -193,10 +196,10 @@ __printf_fphex (FILE *fp,
   /* Buffer for the generated number string for the mantissa.  The
      maximal size for the mantissa is 128 bits.  */
   char numbuf[32];
-  char *numstr;
+  char *numstr="";
   char *numend;
   wchar_t wnumbuf[32];
-  wchar_t *wnumstr;
+  wchar_t *wnumstr=L"";
   wchar_t *wnumend;
   int negative;
 
@@ -205,14 +208,14 @@ __printf_fphex (FILE *fp,
   char *expstr;
   wchar_t wexpbuf[5];
   wchar_t *wexpstr;
-  int expnegative;
-  int exponent;
+  int expnegative = 0;
+  int exponent = 0;
 
   /* Non-zero is mantissa is zero.  */
-  int zero_mantissa;
+  int zero_mantissa = 1;
 
   /* The leading digit before the decimal point.  */
-  char leading;
+  char leading = '0';
 
   /* Precision.  */
   int precision = info->prec;


Other related posts:

  • » [haiku-commits] BRANCH HaikuPM-github.package-management [5657c5e] src/system/libroot/posix/glibc/stdio-common - HaikuPM-github . package-management