diff options
author | Eric Andersen <andersen@codepoet.org> | 2000-07-14 01:13:37 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2000-07-14 01:13:37 +0000 |
commit | 4ac6cb534d78d63d7b0a206118c56bad7024b9f8 (patch) | |
tree | cdf6bf16505e89893739cfc72f39303aa0fff4be | |
parent | ec10b9d534d3c7c215144049b10df175aed02aa9 (diff) | |
download | busybox-w32-4ac6cb534d78d63d7b0a206118c56bad7024b9f8.tar.gz busybox-w32-4ac6cb534d78d63d7b0a206118c56bad7024b9f8.tar.bz2 busybox-w32-4ac6cb534d78d63d7b0a206118c56bad7024b9f8.zip |
Fix some stupid memory bugs.
-Erik
-rw-r--r-- | cmdedit.c | 3 | ||||
-rw-r--r-- | shell/cmdedit.c | 3 |
2 files changed, 2 insertions, 4 deletions
@@ -414,7 +414,6 @@ extern void cmdedit_read_input(char* prompt, char command[BUFSIZ]) | |||
414 | char c = 0; | 414 | char c = 0; |
415 | struct history *hp = his_end; | 415 | struct history *hp = his_end; |
416 | 416 | ||
417 | memset(command, 0, sizeof(command)); | ||
418 | if (!reset_term) { | 417 | if (!reset_term) { |
419 | 418 | ||
420 | getTermSettings(inputFd, (void*) &initial_settings); | 419 | getTermSettings(inputFd, (void*) &initial_settings); |
@@ -462,7 +461,7 @@ extern void cmdedit_read_input(char* prompt, char command[BUFSIZ]) | |||
462 | xwrite(outputFd, prompt, strlen(prompt)); | 461 | xwrite(outputFd, prompt, strlen(prompt)); |
463 | 462 | ||
464 | /* Reset the command string */ | 463 | /* Reset the command string */ |
465 | memset(command, 0, sizeof(command)); | 464 | memset(command, 0, BUFSIZ); |
466 | len = cursor = 0; | 465 | len = cursor = 0; |
467 | 466 | ||
468 | break; | 467 | break; |
diff --git a/shell/cmdedit.c b/shell/cmdedit.c index b94b8e331..0f064b414 100644 --- a/shell/cmdedit.c +++ b/shell/cmdedit.c | |||
@@ -414,7 +414,6 @@ extern void cmdedit_read_input(char* prompt, char command[BUFSIZ]) | |||
414 | char c = 0; | 414 | char c = 0; |
415 | struct history *hp = his_end; | 415 | struct history *hp = his_end; |
416 | 416 | ||
417 | memset(command, 0, sizeof(command)); | ||
418 | if (!reset_term) { | 417 | if (!reset_term) { |
419 | 418 | ||
420 | getTermSettings(inputFd, (void*) &initial_settings); | 419 | getTermSettings(inputFd, (void*) &initial_settings); |
@@ -462,7 +461,7 @@ extern void cmdedit_read_input(char* prompt, char command[BUFSIZ]) | |||
462 | xwrite(outputFd, prompt, strlen(prompt)); | 461 | xwrite(outputFd, prompt, strlen(prompt)); |
463 | 462 | ||
464 | /* Reset the command string */ | 463 | /* Reset the command string */ |
465 | memset(command, 0, sizeof(command)); | 464 | memset(command, 0, BUFSIZ); |
466 | len = cursor = 0; | 465 | len = cursor = 0; |
467 | 466 | ||
468 | break; | 467 | break; |