Initializacia

This commit is contained in:
Kozar 2024-10-02 17:06:57 +00:00
parent 969442f6e7
commit f7276b6c98

View File

@ -54,7 +54,12 @@ int read_pizza(struct pizza *item) {
return 0;
}
item->price = strtof(line, NULL);
char *endptr;
item->price = strtof(line, &endptr);
if (endptr == line || *endptr != '\n') {
return 0;
}
return 1;
}