Initializacia
This commit is contained in:
parent
969442f6e7
commit
f7276b6c98
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user