about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/computil.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c
index f6c9b54e9..f83bef9cc 100644
--- a/Src/Zle/computil.c
+++ b/Src/Zle/computil.c
@@ -579,8 +579,8 @@ cd_get(char **params)
                     memset(buf, ' ', cd_state.pre);
                     memcpy(buf, str->str, str->len);
                     strcpy(sufp, str->desc);
-                    if (strlen(buf) >= columns)
-                        buf[columns] = '\0';
+                    if (strlen(buf) >= columns - 1)
+                        buf[columns - 1] = '\0';
                     *dp++ = ztrdup(buf);
                 }
                 *mp = *dp = NULL;