about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/Modules/hlgroup.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Src/Modules/hlgroup.c b/Src/Modules/hlgroup.c
index 6382f3216..9c0aedcf8 100644
--- a/Src/Modules/hlgroup.c
+++ b/Src/Modules/hlgroup.c
@@ -59,6 +59,10 @@ convertattr(char *attrstr, int sgr)
 	    *t = ';';
 	    c++;
 	}
+	if (t <= s) { /* always return at least "0" */
+	    *s = '0';
+	    t = s + 1;
+	}
 	*t = '\0';
 	len = t - s;
     }