From e236a2345eb21598cd973b99dbc3801dfbac2678 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 16 Aug 2026 11:44:32 -0700 Subject: [PATCH] =?UTF-8?q?sed:=20MB=5FLEN=5FMAX=E2=86=92MCEL=5FCUR=5FMAX?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * sed/debug.c (debug_print_mb): * sed/execute.c (str_append_modified, do_list, translate_mb): Prefer MCEL_LEN_MAX to MB_LEN_MAX where either will do. --- sed/debug.c | 2 +- sed/execute.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sed/debug.c b/sed/debug.c index 7816305..dc80866 100644 --- a/sed/debug.c +++ b/sed/debug.c @@ -235,7 +235,7 @@ debug_print_mb (int ch) fputc (-ch, stdout); else { - char buf[MB_LEN_MAX]; + char buf[MCEL_LEN_MAX]; fwrite (buf, 1, c32rtomb1 (buf, ch), stdout); } } diff --git a/sed/execute.c b/sed/execute.c index d521e2f..f9b1ac2 100644 --- a/sed/execute.c +++ b/sed/execute.c @@ -169,7 +169,7 @@ str_append_modified (struct line *to, const char *string, idx_t length, } idx_t worst_case_growth; - if (ckd_mul (&worst_case_growth, length, MB_LEN_MAX)) + if (ckd_mul (&worst_case_growth, length, MCEL_LEN_MAX)) xalloc_die (); if (to->alloc - to->length < worst_case_growth) resize_line (to, worst_case_growth); @@ -841,7 +841,7 @@ do_list (intmax_t line_len) for (char *p = line.active; p < plim; p += g.len) { g = mcel_scan (p, plim); - char obuf[(sizeof "\\377" - 1) * MB_LEN_MAX]; + char obuf[(sizeof "\\377" - 1) * MCEL_LEN_MAX]; char *o = obuf; *o = '\\'; if (c32isprint (g.ch)) @@ -1117,7 +1117,7 @@ translate_mb (idx_t npairs, int *pair) { bool move_remain_buffer = false; int tr = pair[2 * i + 1]; - char mbuf[MB_LEN_MAX]; + char mbuf[MCEL_LEN_MAX]; idx_t trans_len; if (tr < 0) {