From 24159e021406a24a13563e4d80aadb55c0fc62ab Mon Sep 17 00:00:00 2001
From: Přemysl Janouch
Date: Tue, 12 May 2015 02:48:12 +0200
Subject: degesch: fix mIRC color parsing
---
degesch.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/degesch.c b/degesch.c
index a4dbb3e..d1f6bca 100644
--- a/degesch.c
+++ b/degesch.c
@@ -1987,10 +1987,11 @@ formatter_parse_mirc_color (struct formatter *self, const char *s)
if (*s != ',' || !isdigit_ascii (s[1]))
return s;
+ s++;
- int bg = *++s - '0';
- if (isdigit_ascii (s[1]))
- bg = bg * 10 + (*++s - '0');
+ int bg = *s++ - '0';
+ if (isdigit_ascii (*s))
+ bg = bg * 10 + (*s++ - '0');
if (bg >= 0 && bg < 16)
FORMATTER_ADD_ITEM (self, BG_COLOR, .color = g_mirc_to_terminal[bg]);
--
cgit v1.2.3-70-g09d2