From e72fffd3f1c4d0a23c2c1f7616909209993eaa50 Mon Sep 17 00:00:00 2001 From: Sophia Weber Date: Sun, 28 Jan 2024 12:14:26 +0100 Subject: [PATCH] refactoring: global variable changed --- src/inputHandling.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/inputHandling.c b/src/inputHandling.c index 6229f21..58e692b 100644 --- a/src/inputHandling.c +++ b/src/inputHandling.c @@ -4,7 +4,7 @@ #include -char data[1000]; +char formulaBuffer[1000]; void deleteWhitespace(char* formulaString, int length); op readFunction(char* formulaString, int length); char* getNumbers(char* formulaString, int length, calc_op* formulaRef); @@ -14,10 +14,10 @@ void showStruct(calc_op* formulaRef); void input(char* formulaString, int length) { deleteWhitespace(formulaString, length); calc_op temp; - memcpy(data, formulaString, length); + memcpy(formulaBuffer, formulaString, length); temp.formel = formulaString; - temp.funktionstyp = readFunction(data, 10); - if (getNumbers(data, length, &temp) == NULL){ + temp.funktionstyp = readFunction(formulaBuffer, 10); + if (getNumbers(formulaBuffer, length, &temp) == NULL){ showStruct(&temp); } else { printf("Formular %s not supported", temp.formel);