From 6e6b18e06783a19803afc9c4a031d3a26eac682e Mon Sep 17 00:00:00 2001 From: st529yr Date: Fri, 22 Mar 2024 00:11:37 +0100 Subject: [PATCH] funguje --- cv5/program.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cv5/program.c b/cv5/program.c index 9a20a1c..47db4c1 100644 --- a/cv5/program.c +++ b/cv5/program.c @@ -52,10 +52,8 @@ int main() { } // Kopírovanie mena - strcpy(meno, endptr); - - // Odstránenie konca riadka z mena - meno[len - 1] = '\0'; + memcpy(meno, endptr, len); + meno[len] = '\0'; // Nulový znak na koniec mena // Zistiť, či študent už existuje v databáze int index = find_student_index(students, num_students, meno);