diff options
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -91,7 +91,10 @@ int main(void) { const struct com_struct new_input = split_command(input); new_input.com[strcspn(new_input.com, "\n")] = '\0'; - new_input.arg[strcspn(new_input.arg, "\n")] = '\0'; + + if (new_input.arg != NULL) { + new_input.arg[strcspn(new_input.arg, "\n")] = '\0'; + } if (strcmp(new_input.com, "exit") == 0) { free(input); |
