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