From f9559e41523cd573f98f4712a7ab4468bdfc411c Mon Sep 17 00:00:00 2001 From: Sophia Weber Date: Sat, 27 Jan 2024 17:56:59 +0100 Subject: [PATCH] fix formular parse detection bug again --- src/inputHandling.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/inputHandling.c b/src/inputHandling.c index f2edfc1..d4f4446 100644 --- a/src/inputHandling.c +++ b/src/inputHandling.c @@ -83,15 +83,16 @@ char* getnumbers(char* data, int length, calc_op* structure_ref){ //input sind: token = strtok(NULL, "+"); //Sucht von der letzten Plus-Stelle an weiter } structure_ref->arraylength=i; //Länge des Arrays (also zu berechnende Zahlen) gespeichert - if (readFunction(splitPnt, strlen(splitPnt)+1)!=opNotSupported){ - return NULL; - } else { + op type = readFunction(splitPnt, strlen(splitPnt)+1); + if (type != opNotSupported && type != opEmpty){ return splitPnt; + } else { + return NULL; } } void printstruct(calc_op* formula){ - printf("Berechnung: %s", formula->formel); + printf("Berechnung: %s\n", formula->formel); switch (formula->funktionstyp) { case opAdd: printf("Rechenoperation: Addition\n"); break;