From f709f5b20e611c2d97252e4d564228e2cfb08676 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Vl=C4=8Dek?= Date: Wed, 15 Apr 2026 09:34:56 +0000 Subject: [PATCH] Aktualizovat du5/program.c --- du5/program.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/du5/program.c b/du5/program.c index a1d954e..e6c5e70 100644 --- a/du5/program.c +++ b/du5/program.c @@ -109,13 +109,8 @@ int main() break; } //nahradi NewLine symbol za null terminator (Newline sa prida naspat potom na konci programu) - for (int i = 0; i < SIZE; i++) - { - if (buffer[i] == '\n') - { - buffer[i] = '\0'; - } - } + buffer[strcspn(buffer, "\n")] = '\0'; + strcpy(lines[lineCount], buffer); lineCount += 1; }