diff --git a/cv1/program.c b/cv1/program.c index bcd33f9..1ee33bb 100644 --- a/cv1/program.c +++ b/cv1/program.c @@ -36,25 +36,20 @@ void transform_to_hacker_script(const char *src, char *dest) { int contains_normalized(const char *name, const char *search) { char transformed_name[LINESIZE], transformed_search[LINESIZE]; - transform_to_hacker_script(name, transformed_name); transform_to_hacker_script(search, transformed_search); - return strstr(transformed_name, transformed_search) != NULL; } int read_pizza(struct pizza *item) { char line[LINESIZE]; - if (!fgets(item->name, LINESIZE, stdin)) { return 0; } item->name[strcspn(item->name, "\n")] = '\0'; - if (!fgets(line, LINESIZE, stdin)) { return 0; } - item->price = strtof(line, NULL); return 1; } @@ -66,7 +61,6 @@ int main() { printf("Zadaj hladanu surovinu:\n"); if (!fgets(search, LINESIZE, stdin)) { - printf("Error reading input.\n"); return 1; } search[strcspn(search, "\n")] = '\0'; @@ -89,6 +83,5 @@ int main() { } printf("Nacitanych %d poloziek.\n", count); - return 0; -} \ No newline at end of file +}