Repair truncation in oldstyle mode.
authorEric S. Raymond <esr@thyrsus.com>
Fri, 20 Sep 2024 14:49:44 +0000 (10:49 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Fri, 20 Sep 2024 14:49:44 +0000 (10:49 -0400)
Sure would be nice to remember while this code had TOKEN + TOKEN
where one would think it should just say TOKEN.

misc.c

diff --git a/misc.c b/misc.c
index aa11786e70fdee47426883a992d827263c662d09..533735b4fc20f8c419a6dc809aac0c2fdcbb28be 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -514,8 +514,7 @@ static void tokenize(char *raw, command_t *cmd) {
         * possible an emulation of the original UI.
         */
        if (settings.oldstyle) {
-               cmd->word[0].raw[TOKLEN + TOKLEN] =
-                   cmd->word[1].raw[TOKLEN + TOKLEN] = '\0';
+               cmd->word[0].raw[TOKLEN] = cmd->word[1].raw[TOKLEN] = '\0';
                for (size_t i = 0; i < strlen(cmd->word[0].raw); i++) {
                        cmd->word[0].raw[i] = toupper(cmd->word[0].raw[i]);
                }