tled: do not touch ai array led_line() when ai_max is zero - neatvi - [fork] simple vi-type editor with UTF-8 support
(HTM) git clone git://src.adamsgaard.dk/neatvi
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
---
(DIR) commit 141f09f6ec82e918ff772e02500c7903be72e50e
(DIR) parent efd7a38d55441a6ef6c48e7056e5d55c7755fae3
(HTM) Author: Ali Gholami Rudi <ali@rudi.ir>
Date: Thu, 19 Nov 2020 10:47:47 +0330
led: do not touch ai array led_line() when ai_max is zero
Diffstat:
M led.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
---
(DIR) diff --git a/led.c b/led.c
t@@ -286,9 +286,10 @@ static char *led_line(char *pref, char *post, char *ai,
sbuf_cut(sb, led_lastword(sbuf_buf(sb)));
break;
case TK_CTL('t'):
- if (ai_len < ai_max)
+ if (ai_len < ai_max) {
ai[ai_len++] = '\t';
- ai[ai_len] = '\0';
+ ai[ai_len] = '\0';
+ }
break;
case TK_CTL('d'):
/* when ai and pref are empty, remove the first space of sb */