Thumbnail

rani/cscroll.git

Clone URL: https://git.buni.party/rani/cscroll.git

commit 3b2cb111c17e60da0de9623c1a7f5f84cc1af9c8 Author: rani <clagv.randomgames@gmail.com> Date: Thu Jun 02 15:52:38 2022 +0000 fix off-by-one error in memory allocation diff --git a/src/type.c b/src/type.c index a18f6aa..115479c 100644 --- a/src/type.c +++ b/src/type.c @@ -477 +477 @@ char * get_icon(struct dir_entry_t * f) {   char * t_ext = get_ext(f->name);   struct icon_pair * t = NULL;   if (t_ext) { - char * ext = malloc(strlen(t_ext)); + char * ext = malloc(strlen(t_ext) + 1);   strcpy(ext, t_ext);   lowers(ext);