From 8b0aa8e2b552f57aaf8c6c9dfa164219aa85932d Mon Sep 17 00:00:00 2001 From: ache Date: Fri, 13 Sep 2019 00:37:33 +0200 Subject: Fix color message bug --- messageWind.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'messageWind.c') diff --git a/messageWind.c b/messageWind.c index 5b71b5e..2c788a5 100644 --- a/messageWind.c +++ b/messageWind.c @@ -69,7 +69,8 @@ int show1SMS(sms* S, int y_base, int* hasFinish) { *hasFinish = 1; - attrset( COLOR_PAIR( (rand()%8) + 2) | A_BOLD); + int nbColors = 7 - 1; + attrset( COLOR_PAIR( (rand() % nbColors) + 2) | A_BOLD); while( S->text[iS] ) { x = 0; while( x < w_WMessageSMS-1 && S->text[iS]) { -- cgit v1.2.3