diff --git a/src/bin/channel.c b/src/bin/channel.c index 95b59b8..a247edd 100644 --- a/src/bin/channel.c +++ b/src/bin/channel.c @@ -997,17 +997,16 @@ _channel_text_append(Channel *chl, const char *user, const char *txt, Row_Color if (user) { /* If user is * ie for messages use a different color */ - int user_color = 31; Row_Color *ucolor; - if (strncmp(user, "*", strlen(user)) == 0) - { - user_color = 78; - } + if (!strncmp(user, "*", strlen(user))) + ucolor = _row_color_simple_create(78); + else + ucolor = _row_color_simple_create(31); - ucolor = _row_color_simple_create(user_color); _grid_text_append(chl->o_grid, user, strlen(user), ucolor); _grid_text_append(chl->o_grid, "\t", strlen("\t"), ucolor); + if (ucolor) free(ucolor); }