]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
cut: use MCEL_LEN_MAX rather than MB_LEN_MAX
authorPádraig Brady <P@draigBrady.com>
Wed, 29 Apr 2026 10:48:15 +0000 (11:48 +0100)
committerPádraig Brady <P@draigBrady.com>
Wed, 29 Apr 2026 12:16:21 +0000 (13:16 +0100)
* src/cut.c: We use the mcel interface to populate these arrays,
so restrict to the mcel supported max.  This is more efficient
as generally stateful encodings are not used or supported.

src/cut.c

index 6fa4d0727ef822f75667364d3e472a808e331f0b..3ec406586e563d715ccc7cd7f6d015bb2c56e7b8 100644 (file)
--- a/src/cut.c
+++ b/src/cut.c
@@ -90,7 +90,7 @@ static bool complement;
 static mcel_t delim_mcel;
 
 /* The delimiter bytes.  */
-static char delim_bytes[MB_LEN_MAX];
+static char delim_bytes[MCEL_LEN_MAX];
 
 /* The delimiter for each line/record.  */
 static unsigned char line_delim = '\n';
@@ -103,7 +103,7 @@ static size_t output_delimiter_length;
 static char *output_delimiter_string;
 
 /* The output delimiter string contents, if the default.  */
-static char output_delimiter_default[MB_LEN_MAX];
+static char output_delimiter_default[MCEL_LEN_MAX];
 
 /* True if we have ever read standard input.  */
 static bool have_read_stdin;