diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2015-05-12 02:48:12 +0200 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2015-05-12 02:48:12 +0200 |
commit | 24159e021406a24a13563e4d80aadb55c0fc62ab (patch) | |
tree | bdd1a519780356557f793670ed3927f13eda0dc0 | |
parent | 2d040cae734fcc5f4c8c03b06b9427d677b75012 (diff) | |
download | xK-24159e021406a24a13563e4d80aadb55c0fc62ab.tar.gz xK-24159e021406a24a13563e4d80aadb55c0fc62ab.tar.xz xK-24159e021406a24a13563e4d80aadb55c0fc62ab.zip |
degesch: fix mIRC color parsing
-rw-r--r-- | degesch.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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]); |