commit f3c3ed06c8378065c7acd865be558dc91c097f3e
parent 42c2b3969231bcdf767cee64cd65d6634363abd1
Author: night0721 <[email protected]>
Date: Wed, 3 Jul 2024 13:14:31 +0100
Remove unnecessary code
Diffstat:
2 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/src/syntax.c b/src/syntax.c
@@ -26,14 +26,12 @@ char *syntax_to_color(int hl, size_t *len)
case HL_MATCH:;
char *str = malloc(COLOR_LEN * 2 + 1);
snprintf(str, COLOR_LEN * 2 + 1, "%s%s", BLACK_BG, SKY_FG);
- str[COLOR_LEN * 2] = '\0';
*len = COLOR_LEN * 2;
return str;
case HL_RESET:;
char *res = malloc(COLOR_LEN * 2 + 1);
snprintf(res, COLOR_LEN * 2 + 1, "%s%s", WHITE_BG, BLACK_FG);
- res[COLOR_LEN * 2] = '\0';
*len = COLOR_LEN * 2;
return res;
diff --git a/src/vip.c b/src/vip.c
@@ -178,7 +178,6 @@ void draw_rows(struct abuf *ab)
memcpy(current_color, color, len);
abAppend(ab, color, len);
}
- fclose(f);
free(color);
abAppend(ab, &c[j], 1);
}