From 9135a8412ba56b96a8f290cf9c3a5f81ed3d90a7 Mon Sep 17 00:00:00 2001 From: Michal Utlak Date: Wed, 13 Mar 2024 12:08:51 +0100 Subject: [PATCH] final fix --- cv5/program.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cv5/program.c b/cv5/program.c index bec9e8f..c25d16a 100644 --- a/cv5/program.c +++ b/cv5/program.c @@ -25,14 +25,17 @@ int main() { char *r = fgets(line, SIZE, stdin); if (r == NULL) { - break; + break; + } + + if (strcmp(line, "\n") == 0) { + continue; } int value = strtol(line, NULL, 10); if (value == 0) { - continue; + break; } - char name[SIZE]; memset(name, 0, SIZE); char *zaciatok_mena = strchr(line, ' ') + 1;