From f64fcb259dbd914ec0ab9fe8d109e2bc55dabb02 Mon Sep 17 00:00:00 2001 From: night0721 Date: Sun, 19 May 2024 17:21:18 +0100 Subject: [PATCH] fix total lines and total --- lcc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lcc.c b/lcc.c index 43f38ac..2852c2b 100644 --- a/lcc.c +++ b/lcc.c @@ -166,7 +166,8 @@ int main(int argc, char **argv) printf("%-10s %-6d %-6d %-8d %-6d %-6d\n", stats[i].name, stats[i].files, code_lines, stats[i].comments, stats[i].blanks, stats[i].lines); } } - printf("%-10s %-6d %-6d %-8d %-6d %-6d\n", "Total", total_stats.files, total_stats.lines, total_stats.comments, total_stats.blanks, total_stats.lines); + int total_code_lines = total_stats.lines - total_stats.blanks - total_stats.comments; + printf("%-10s %-6d %-6d %-8d %-6d %-6d\n", "Total", total_stats.files, total_code_lines, total_stats.comments, total_stats.blanks, total_stats.lines); return 0;