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