From 67b99b1cece8546126405f69877935cacc82bb21 Mon Sep 17 00:00:00 2001 From: nova Date: Mon, 3 Nov 2025 19:44:20 +0100 Subject: [PATCH] fixed wrong color being saved as a result of improper string size handling --- dir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dir.c b/dir.c index df3f9c9..6fea069 100644 --- a/dir.c +++ b/dir.c @@ -107,7 +107,7 @@ void get_dir_content(char *path, unsigned long *dir_file_count, file *dir_conten char *extension = strrchr(entry[i]->d_name, '.'); if (extension) { for (j = 0; j < color_count; j++) { - if (!strncmp(colors[j].file_extension, extension, strlen(colors[j].file_extension))) { + if (!strcmp(colors[j].file_extension, extension)) { dir_content[i].color_pair = colors[j].color_pair; } } @@ -130,7 +130,7 @@ void get_dir_content(char *path, unsigned long *dir_file_count, file *dir_conten char *extension = strrchr(entry[i]->d_name, '.'); if (extension) { for (j = 0; j < color_count; j++) { - if (!strncmp(colors[j].file_extension, extension, strlen(colors[j].file_extension))) { + if (!strcmp(colors[j].file_extension, extension)) { dir_content[i].color_pair = colors[j].color_pair; } }