version 1.44, 2017/12/11 13:25:57 |
version 1.45, 2017/12/12 12:52:01 |
|
|
compile_tr(char *old, char **transtab) |
compile_tr(char *old, char **transtab) |
{ |
{ |
int i; |
int i; |
char delimiter, check[UCHAR_MAX]; |
char delimiter, check[UCHAR_MAX + 1]; |
char *new, *end; |
char *new, *end; |
|
|
memset(check, 0, sizeof(check)); |
memset(check, 0, sizeof(check)); |
|
|
if (check[*old] == 1) |
if (check[*old] == 1) |
error(COMPILE, "Repeated character in source string"); |
error(COMPILE, "Repeated character in source string"); |
check[*old] = 1; |
check[*old] = 1; |
(*transtab)[*old++] = *new++; |
(*transtab)[(u_char) *old++] = *new++; |
} |
} |
if (*old != '\0' || *new != '\0') |
if (*old != '\0' || *new != '\0') |
error(COMPILE, "transform strings are not the same length"); |
error(COMPILE, "transform strings are not the same length"); |