=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/sed/compile.c,v retrieving revision 1.44 retrieving revision 1.45 diff -c -r1.44 -r1.45 *** src/usr.bin/sed/compile.c 2017/12/11 13:25:57 1.44 --- src/usr.bin/sed/compile.c 2017/12/12 12:52:01 1.45 *************** *** 1,4 **** ! /* $OpenBSD: compile.c,v 1.44 2017/12/11 13:25:57 martijn Exp $ */ /*- * Copyright (c) 1992 Diomidis Spinellis. --- 1,4 ---- ! /* $OpenBSD: compile.c,v 1.45 2017/12/12 12:52:01 martijn Exp $ */ /*- * Copyright (c) 1992 Diomidis Spinellis. *************** *** 603,609 **** compile_tr(char *old, char **transtab) { int i; ! char delimiter, check[UCHAR_MAX]; char *new, *end; memset(check, 0, sizeof(check)); --- 603,609 ---- compile_tr(char *old, char **transtab) { int i; ! char delimiter, check[UCHAR_MAX + 1]; char *new, *end; memset(check, 0, sizeof(check)); *************** *** 652,658 **** if (check[*old] == 1) error(COMPILE, "Repeated character in source string"); check[*old] = 1; ! (*transtab)[*old++] = *new++; } if (*old != '\0' || *new != '\0') error(COMPILE, "transform strings are not the same length"); --- 652,658 ---- if (check[*old] == 1) error(COMPILE, "Repeated character in source string"); check[*old] = 1; ! (*transtab)[(u_char) *old++] = *new++; } if (*old != '\0' || *new != '\0') error(COMPILE, "transform strings are not the same length");