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