diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2008-09-24 11:57:47 +0000 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2008-09-24 11:57:47 +0000 |
commit | e8b65126450b775fa826a49e4b1464785bc036a2 (patch) | |
tree | c679057c54363250b9c41bd4aa305f0335654949 /extra | |
parent | 6c29d46610fe437f2571c8fadec475d110bb9554 (diff) | |
download | uClibc-alpine-e8b65126450b775fa826a49e4b1464785bc036a2.tar.bz2 uClibc-alpine-e8b65126450b775fa826a49e4b1464785bc036a2.tar.xz |
- do not segfault if we end up with empty tables
- silence some warnings while at it
Diffstat (limited to 'extra')
-rw-r--r-- | extra/locale/Makefile.in | 1 | ||||
-rw-r--r-- | extra/locale/gen_wctype.c | 18 |
2 files changed, 15 insertions, 4 deletions
diff --git a/extra/locale/Makefile.in b/extra/locale/Makefile.in index 52de0f26e..078eb6527 100644 --- a/extra/locale/Makefile.in +++ b/extra/locale/Makefile.in @@ -25,6 +25,7 @@ BUILD_CFLAGS-gen_ldc += -D__WCHAR_ENABLED=1 endif BUILD_CFLAGS-gen_locale := -D_GNU_SOURCE +BUILD_CFLAGS-gen_collate := -D_GNU_SOURCE DEPH-locale := $(top_builddir)include/bits/sysnum.h DEPH-gen_locale := c8tables.h diff --git a/extra/locale/gen_wctype.c b/extra/locale/gen_wctype.c index 085ec51b1..dca5cff0d 100644 --- a/extra/locale/gen_wctype.c +++ b/extra/locale/gen_wctype.c @@ -130,7 +130,7 @@ enum { #define mywalnum(x) __CTYPE_isalnum(d) #define mywalpha(x) __CTYPE_isalpha(d) -#define mywblank(x) __CTYPE_isblank(d) +#define mywblank(x) __CTYPE_isblank(d) #define mywcntrl(x) __CTYPE_iscntrl(d) #define mywdigit(x) __CTYPE_isdigit(d) #define mywgraph(x) __CTYPE_isgraph(d) @@ -231,10 +231,11 @@ int main(int argc, char **argv) uldiff_entry uldiff[MAXTO]; table_data cttable; table_data ultable; +#if 0 table_data combtable; table_data widthtable; long int last_comb = 0; - +#endif unsigned char wct[(RANGE/2)+1]; /* wctype table (nibble per wchar) */ unsigned char ult[RANGE+1]; /* upper/lower table */ unsigned char combt[(RANGE/4)+1]; /* combining */ @@ -269,6 +270,12 @@ int main(int argc, char **argv) INIT_TYPENAME(cntrl_space_blank); INIT_TYPENAME(cntrl_nonspace); + memset(&cttable, 0, sizeof(table_data)); + memset(&ultable, 0, sizeof(table_data)); +#if 0 + memset(combtable, 0, sizeof table_data); + memset(widthtable, 0, sizeof table_data); +#endif setvbuf(stdout, NULL, _IONBF, 0); while (--argc) { @@ -594,7 +601,9 @@ int main(int argc, char **argv) dump_table_data(&cttable); dump_table_data(&ultable); +#if 0 dump_table_data(&combtable); +#endif } printf("verifying for %s...\n", *argv); @@ -756,8 +765,8 @@ int main(int argc, char **argv) fprintf(fp, "#endif /* WANT_WCuplow_diff_data */\n\n"); -/* output_table(fp, "comb", &combtable); */ -/* output_table(fp, "width", &widthtable); */ +/* output_table(fp, "comb", &combtable); */ +/* output_table(fp, "width", &widthtable); */ fclose(fp); } @@ -874,3 +883,4 @@ size_t newopt(unsigned char *ut, size_t usize, int shift, table_data *tbl) } return smallest; } +/* vi: set sw=4 ts=4: */ |