From f0e2d079242f4fbed79404c1574df81a41e9479b Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 12 Aug 2026 21:37:54 -0700 Subject: [PATCH] sed: remove YMAP_LENGTH * sed/compile.c (YMAP_LENGTH): Remove. All uses replaced by UCHAR_MAX + 1. --- sed/compile.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sed/compile.c b/sed/compile.c index 136c8f9..27079fe 100644 --- a/sed/compile.c +++ b/sed/compile.c @@ -27,8 +27,6 @@ #include "progname.h" #include "xalloc.h" -#define YMAP_LENGTH 256 /*XXX shouldn't this be (UCHAR_MAX+1)?*/ - /* let's not confuse text editors that have only dumb bracket-matching... */ #define OPEN_BRACKET '[' #define CLOSE_BRACKET ']' @@ -1261,13 +1259,13 @@ compile_program (struct vector *vector) else { unsigned char *translate = - OB_MALLOC (&obs, YMAP_LENGTH, unsigned char); + OB_MALLOC (&obs, UCHAR_MAX + 1, unsigned char); unsigned char *ustring = (unsigned char *)src_buf; if (len != dest_len) bad_prog ("'y' command strings have different lengths"); - for (len = 0; len < YMAP_LENGTH; len++) + for (len = 0; len < UCHAR_MAX + 1; len++) translate[len] = len; while (dest_len--)