From 6f6138c25f13f353c99bd40fc157fd83cc6ac87b Mon Sep 17 00:00:00 2001 From: Anton Dolozin Date: Sun, 9 Nov 2025 19:25:57 +0100 Subject: [PATCH] wrhrwj --- du6/program.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/du6/program.c b/du6/program.c index 8ea6629..4974c83 100644 --- a/du6/program.c +++ b/du6/program.c @@ -77,14 +77,13 @@ int main(void){ char line[SIZE]; - while( fgets(line, sizeof(line), stdin)){ - line[strcspn(line, "\n")] = '\0'; - if(line[0] == '\0'){ - whitespace = true; - break; - } + while( fgets(line, sizeof(line), stdin)){ + if(strcmp(line, "\n\n") == 0){ + whitespace = true; + break; + } - } + } int numOfLeaves = count_leaves(tree); char answer[SIZE]; bool exs = false;