summary refs log tree commit diff
path: root/format.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-09-13 15:17:41 -0400
committerJune McEnroe <june@causal.agency>2018-09-13 15:17:41 -0400
commit9a69869d392ca9ac9e2d845dec5f4dfecdbf3456 (patch)
tree7179e65680da647300158cf2eb0549f593e20030 /format.c
parentReturn a format->split even at the end of the string (diff)
downloadcatgirl-9a69869d392ca9ac9e2d845dec5f4dfecdbf3456.tar.gz
catgirl-9a69869d392ca9ac9e2d845dec5f4dfecdbf3456.zip
Add IRCDefault to colors enum
Diffstat (limited to '')
-rw-r--r--format.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/format.c b/format.c
index b9cd8b1..cb9cb15 100644
--- a/format.c
+++ b/format.c
@@ -25,15 +25,15 @@ void formatReset(struct Format *format) {
 	format->italic = false;
 	format->underline = false;
 	format->reverse = false;
-	format->fg = -1;
-	format->bg = -1;
+	format->fg = IRCDefault;
+	format->bg = IRCDefault;
 }
 
 static void parseColor(struct Format *format) {
 	size_t len = MIN(wcsspn(format->str, L"0123456789"), 2);
 	if (!len) {
-		format->fg = -1;
-		format->bg = -1;
+		format->fg = IRCDefault;
+		format->bg = IRCDefault;
 		return;
 	}
 	format->fg = 0;
@@ -41,7 +41,7 @@ static void parseColor(struct Format *format) {
 		format->fg *= 10;
 		format->fg += format->str[i] - L'0';
 	}
-	if (format->fg > IRCLightGray) format->fg = -1;
+	if (format->fg > IRCLightGray) format->fg = IRCDefault;
 	format->str = &format->str[len];
 
 	len = 0;
@@ -54,7 +54,7 @@ static void parseColor(struct Format *format) {
 		format->bg *= 10;
 		format->bg += format->str[1 + i] - L'0';
 	}
-	if (format->bg > IRCLightGray) format->bg = -1;
+	if (format->bg > IRCLightGray) format->bg = IRCDefault;
 	format->str = &format->str[1 + len];
 }