Fixing
This commit is contained in:
parent
1ad43d39a8
commit
4571891c89
@ -96,15 +96,11 @@ void process_operations(struct stack* stack) {
|
||||
}
|
||||
// endpointer pre nacitanie pomocou strtof;
|
||||
char *endptr;
|
||||
// ked' format nie je spravny, prerusime a vypiseme chybu
|
||||
if (line[0] == '.')
|
||||
{ printf("bad input\n");
|
||||
return;
|
||||
}
|
||||
|
||||
// skusame nacitat' vstup
|
||||
float val = strtof(line, &endptr);
|
||||
// v pripade ze nie je cislo prerusime a vypiseme chubu
|
||||
if (endptr == line) {
|
||||
if (endptr != '\0') {
|
||||
printf("bad input\n");
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user