Fixed empty string args

This commit is contained in:
2025-03-28 16:12:33 -05:00
parent 5ab7dd1f57
commit 7a3d7a5868
2 changed files with 1 additions and 3 deletions

View File

@ -211,7 +211,6 @@ void consoleExec(const char_t *line) {
break; break;
case CONSOLE_EXEC_STATE_ARG_PARSED: case CONSOLE_EXEC_STATE_ARG_PARSED:
assertTrue(j != 0, "Empty argument?");
buffer[j] = '\0'; buffer[j] = '\0';
stringCopy(exec->argv[exec->argc++], buffer, CONSOLE_LINE_MAX); stringCopy(exec->argv[exec->argc++], buffer, CONSOLE_LINE_MAX);
state = CONSOLE_EXEC_STATE_FIND_ARG; state = CONSOLE_EXEC_STATE_FIND_ARG;

View File

@ -25,8 +25,7 @@ int main() {
consoleRegCmd("exit", cmdExit); consoleRegCmd("exit", cmdExit);
consoleRegVar("test", "Hello", testChange); consoleRegVar("test", "Hello", testChange);
consolePrint("init"); consolePrint(" = Dusk Console = ");
// consolePrint(" = Dusk Console = ");
char_t buffer[CONSOLE_LINE_MAX * 10]; char_t buffer[CONSOLE_LINE_MAX * 10];
while(fgets(buffer, sizeof(buffer), stdin)) { while(fgets(buffer, sizeof(buffer), stdin)) {