summaryrefslogtreecommitdiff
path: root/src/fe-common
diff options
context:
space:
mode:
authorailin-nemui <ailin-nemui@users.noreply.github.com>2016-12-15 18:01:26 +0100
committerailin-nemui <ailin-nemui@users.noreply.github.com>2016-12-15 18:01:26 +0100
commit7b856d628bfd6c775dfaee2138a3542ee13b1960 (patch)
tree8184c351c33e0dc919f2948617ca89e5e8148c79 /src/fe-common
parent618c8bd10e45b3132d356e2f6bec290a63b8a9fa (diff)
downloadirssi-7b856d628bfd6c775dfaee2138a3542ee13b1960.zip
check for end of string in ansi 48
Diffstat (limited to 'src/fe-common')
-rw-r--r--src/fe-common/core/formats.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/fe-common/core/formats.c b/src/fe-common/core/formats.c
index a58d839a..a789c0e3 100644
--- a/src/fe-common/core/formats.c
+++ b/src/fe-common/core/formats.c
@@ -956,6 +956,7 @@ static const char *get_ansi_color(THEME_REC *theme, const char *str,
str++;
for (num2 = 0; i_isdigit(*str); str++)
num2 = num2*10 + (*str-'0');
+ if (*str == '\0') return start;
switch (num2) {
case 2:
@@ -973,6 +974,8 @@ static const char *get_ansi_color(THEME_REC *theme, const char *str,
for (; i_isdigit(*str); str++)
num2 = (num2&~0xff) |
(((num2&0xff) * 10 + (*str-'0'))&0xff);
+
+ if (*str == '\0') return start;
}
if (i == -1) break;
@@ -1001,6 +1004,7 @@ static const char *get_ansi_color(THEME_REC *theme, const char *str,
str++;
for (num2 = 0; i_isdigit(*str); str++)
num2 = num2*10 + (*str-'0');
+ if (*str == '\0') return start;
if (num == 38) {
flags &= ~GUI_PRINT_FLAG_COLOR_24_FG;