From 4369ae05bd8450a5f61122fac7c35466847738fa Mon Sep 17 00:00:00 2001 From: SuperNovaa41 Date: Wed, 12 Feb 2025 01:06:08 -0500 Subject: [PATCH] adds small color fix --- src/hex.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/hex.c b/src/hex.c index 23a2cba..81f7ede 100644 --- a/src/hex.c +++ b/src/hex.c @@ -92,15 +92,18 @@ static void write_text(char** text, FILE* stream) { uint i; bool newline; + const char* yellow_str = (flags.coloured) ? YELLOW_TEXT_STR : ""; + const char* green_str = (flags.coloured) ? GREEN_TEXT_STR : ""; + fprintf(stream, " "); for (i = 0; i < flags.cols; i++) { newline = is_newline(false, (*text)[i]); - fprintf(stream, "%s%c%s", (newline ? YELLOW_TEXT_STR : ""), + fprintf(stream, "%s%c%s", (newline ? yellow_str : ""), (newline ? '.' : (*text)[i]), - (newline ? GREEN_TEXT_STR : "")); + (newline ? green_str : "")); } }