This commit is contained in:
2025-11-24 23:05:12 -08:00
parent 542b1d90a0
commit 7245003769

3
main.c
View File

@@ -1752,13 +1752,11 @@ get_cloc_code_lines(const char* filename)
}
if (fgets(buffer, sizeof(buffer), pipe) != NULL) {
// Remove trailing newline
len = strlen(buffer);
if (len > 0 && buffer[len - 1] == '\n') {
buffer[len - 1] = '\0';
}
// Allocate and copy the string
result = malloc(strlen(buffer) + 1);
assert(result != NULL);
if (result) {
@@ -2312,7 +2310,6 @@ loop(void)
int
main(int argc, char *argv[])
{
// Set locale for proper UTF-8 handling
setlocale(LC_ALL, "");
setup_terminal();