25845f
commit 363a98991884a744e78b9bfc7df89768901c0816
25845f
Author: Ondřej Bílka <neleai@seznam.cz>
25845f
Date:   Tue Dec 16 00:09:32 2014 +0100
25845f
25845f
    Return allocated array instead of unallocated.
25845f
    
25845f
    In locale/programs/ld-ctype.c we returned array that was on stack.
25845f
    Fixed by returning static array instead.
25845f
25845f
Index: b/locale/programs/ld-ctype.c
25845f
===================================================================
25845f
--- a/locale/programs/ld-ctype.c
25845f
+++ b/locale/programs/ld-ctype.c
25845f
@@ -113,6 +113,9 @@ struct translit_include_t
25845f
   struct translit_include_t *next;
25845f
 };
25845f
 
25845f
+/* Provide some dummy pointer for empty string.  */
25845f
+static uint32_t no_str[] = { 0 };
25845f
+
25845f
 
25845f
 /* Sparse table of uint32_t.  */
25845f
 #define TABLE idx_table
25845f
@@ -1873,7 +1876,7 @@ find_translit2 (struct locale_ctype_t *c
25845f
 
25845f
 	  for (wi = tirunp->from; wi <= wch; wi += tirunp->step)
25845f
 	    if (wi == wch)
25845f
-	      return (uint32_t []) { 0 };
25845f
+	      return no_str;
25845f
 	}
25845f
     }
25845f
 
25845f
@@ -1927,7 +1930,7 @@ read_widestring (struct linereader *ldfi
25845f
 
25845f
   if (now->tok == tok_default_missing)
25845f
     /* The special name "" will denote this case.  */
25845f
-    wstr = ((uint32_t *) { 0 });
25845f
+    wstr = no_str;
25845f
   else if (now->tok == tok_bsymbol)
25845f
     {
25845f
       /* Get the value from the repertoire.  */
25845f
@@ -4244,12 +4247,9 @@ allocate_arrays (struct locale_ctype_t *
25845f
     }
25845f
   else
25845f
     {
25845f
-      /* Provide some dummy pointers since we have nothing to write out.  */
25845f
-      static uint32_t no_str = { 0 };
25845f
-
25845f
-      ctype->translit_from_idx = &no_str;
25845f
-      ctype->translit_from_tbl = &no_str;
25845f
-      ctype->translit_to_tbl = &no_str;
25845f
+      ctype->translit_from_idx = no_str;
25845f
+      ctype->translit_from_tbl = no_str;
25845f
+      ctype->translit_to_tbl = no_str;
25845f
       ctype->translit_idx_size = 0;
25845f
       ctype->translit_from_tbl_size = 0;
25845f
       ctype->translit_to_tbl_size = 0;