From 9fdb2f3d3594216fad590eaa3a7ccc1aacae4a98 Mon Sep 17 00:00:00 2001 From: ak643du Date: Thu, 25 Apr 2024 17:41:03 +0200 Subject: [PATCH] Initialization --- cv10/program.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cv10/program.c b/cv10/program.c index ae7708c..7648cbc 100644 --- a/cv10/program.c +++ b/cv10/program.c @@ -28,6 +28,9 @@ int main() { int i, found = 0; + // Remove the newline character from the temp_name array + temp_name[strcspn(temp_name, "\n")] = '\0'; + for (i = 0; i < num_accepted; i++) { if (strcmp(names[i], temp_name) == 0) { found = 1; @@ -59,4 +62,4 @@ int main() { } return 0; -} +} \ No newline at end of file