From 4ae838df9d22037273fe97edc25971e6358549fb Mon Sep 17 00:00:00 2001 From: Syndamia Date: Mon, 30 May 2022 20:18:20 +0300 Subject: Autocommit at 30.05.2022 @ 20:18 --- src/ test.table | 5 ----- src/Generic/ConsoleInterface/Menu.cpp | 2 +- src/UserInterface/UserInterface.cpp | 5 ++++- src/test.table | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) delete mode 100644 src/ test.table (limited to 'src') diff --git a/src/ test.table b/src/ test.table deleted file mode 100644 index 147e7e9..0000000 --- a/src/ test.table +++ /dev/null @@ -1,5 +0,0 @@ -8.6,3,"String","= 3 * R0C1 + R0C0 ^ R0C1 * 27 / R0C1 - 2 * 2.5 * 2 * 2 + R0C2 ^ R0C2",, -,,,,, -,,,,, -,,,,, -,,,,, diff --git a/src/Generic/ConsoleInterface/Menu.cpp b/src/Generic/ConsoleInterface/Menu.cpp index 910e946..d547990 100644 --- a/src/Generic/ConsoleInterface/Menu.cpp +++ b/src/Generic/ConsoleInterface/Menu.cpp @@ -51,7 +51,7 @@ void Menu::navigate() const { index = menuOptions.get_count(); for (unsigned i = 0; i < menuOptions.get_count() && index == menuOptions.get_count(); i++) { - if (strncmp(buffer + startIndex, menuOptions[i].get_name(), commandEnd) == 0) + if (strncmp(buffer + startIndex, menuOptions[i].get_name(), commandEnd - startIndex) == 0) index = i; } diff --git a/src/UserInterface/UserInterface.cpp b/src/UserInterface/UserInterface.cpp index bf92f00..d2de4f3 100644 --- a/src/UserInterface/UserInterface.cpp +++ b/src/UserInterface/UserInterface.cpp @@ -78,7 +78,10 @@ void UserInterface::com_print(const char* params) { } void UserInterface::com_edit(const char* params) { - while (*params == ' ') params++; + if (*params != 'R') { + printLine("Error: Invalid cell position format! Expected RC"); + return; + } unsigned row = atoi(++params); while (*params != 'C') params++; diff --git a/src/test.table b/src/test.table index e4ca704..147e7e9 100644 --- a/src/test.table +++ b/src/test.table @@ -1,4 +1,4 @@ -8.6,0,"String","= 3 * R0C1 + R0C0 ^ R0C1 * 27 / R0C1 - 2 * 2.5 * 2 * 2 + R0C2 ^ R0C2",, +8.6,3,"String","= 3 * R0C1 + R0C0 ^ R0C1 * 27 / R0C1 - 2 * 2.5 * 2 * 2 + R0C2 ^ R0C2",, ,,,,, ,,,,, ,,,,, -- cgit v1.3.1-26-gb76a