cleanup: Correct comparison in cons_show_wins()

g_strstr_len() actually returns a gchar* to the position. So it is not
like in the case of strlen() where it returns the number of bytes.
This commit is contained in:
Michael Vetter
2026-02-19 11:45:52 +01:00
parent 61fa8d5b66
commit 3e0c9e79e4

View File

@@ -448,7 +448,7 @@ cons_show_wins(gboolean unread)
GSList* curr = window_strings;
while (curr) {
if (g_strstr_len(curr->data, strlen(curr->data), " unread") > 0) {
if (g_strstr_len(curr->data, strlen(curr->data), " unread") != NULL) {
win_println(console, THEME_CMD_WINS_UNREAD, "-", "%s", curr->data);
} else {
win_println(console, THEME_DEFAULT, "-", "%s", curr->data);
@@ -469,7 +469,7 @@ cons_show_wins_attention(void)
GSList* curr = window_strings;
while (curr) {
if (g_strstr_len(curr->data, strlen(curr->data), " unread") > 0) {
if (g_strstr_len(curr->data, strlen(curr->data), " unread") != NULL) {
win_println(console, THEME_CMD_WINS_UNREAD, "-", "%s", curr->data);
} else {
win_println(console, THEME_DEFAULT, "-", "%s", curr->data);