diff options
Diffstat (limited to 'src/nonstd')
| -rw-r--r-- | src/nonstd/_locale.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nonstd/_locale.h b/src/nonstd/_locale.h index 036fd836..79904e1f 100644 --- a/src/nonstd/_locale.h +++ b/src/nonstd/_locale.h @@ -18,7 +18,7 @@ #define setall(_map, _input, _mask) do { \ size_t _i; \ - for (_i = 0; _i < sizeof(_input); _i++) { \ + for (_i = 0; _i < sizeof(_input) - 1; _i++) { \ _map[(int)_input[_i]] |= _mask; \ } \ } while (0) @@ -61,7 +61,7 @@ static char * (__load_locale)(struct __locale_t *loc, int mask, const char *name char blank[] = " \t"; size_t i; - memset(loc->lc_ctype.ctattr, 0, CHAR_MAX); + memset(loc->lc_ctype.ctattr, 0, sizeof(loc->lc_ctype.ctattr)); for (i = 0; i < 32; i++) { loc->lc_ctype.ctattr[i] = CT_CNTRL; @@ -89,7 +89,7 @@ static char * (__load_locale)(struct __locale_t *loc, int mask, const char *name loc->lc_ctype.ctattr[' '] |= CT_PRINT; - for (i = 0; i < CHAR_MAX; i++) { + for (i = 0; i < UCHAR_MAX; i++) { loc->lc_ctype.ctoupper[i] = i; loc->lc_ctype.ctolower[i] = i; } |
