tled: do not touch ai array led_line() when ai_max is zero - neatvi - [fork] si… | |
git clone git://src.adamsgaard.dk/neatvi | |
Log | |
Files | |
Refs | |
README | |
--- | |
commit 141f09f6ec82e918ff772e02500c7903be72e50e | |
parent efd7a38d55441a6ef6c48e7056e5d55c7755fae3 | |
Author: Ali Gholami Rudi <[email protected]> | |
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(-) | |
--- | |
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 … |