This commit is contained in:
Anton Dolozin 2025-10-08 07:31:58 +02:00
parent 1ad43d39a8
commit 4571891c89

View File

@ -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;
}