From: Eric Andersen Date: Fri, 14 Jul 2000 01:13:37 +0000 (-0000) Subject: Fix some stupid memory bugs. X-Git-Tag: 0_47~254 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4ac6cb534d78d63d7b0a206118c56bad7024b9f8;p=platform%2Fupstream%2Fbusybox.git Fix some stupid memory bugs. -Erik --- diff --git a/cmdedit.c b/cmdedit.c index b94b8e3..0f064b4 100644 --- a/cmdedit.c +++ b/cmdedit.c @@ -414,7 +414,6 @@ extern void cmdedit_read_input(char* prompt, char command[BUFSIZ]) char c = 0; struct history *hp = his_end; - memset(command, 0, sizeof(command)); if (!reset_term) { getTermSettings(inputFd, (void*) &initial_settings); @@ -462,7 +461,7 @@ extern void cmdedit_read_input(char* prompt, char command[BUFSIZ]) xwrite(outputFd, prompt, strlen(prompt)); /* Reset the command string */ - memset(command, 0, sizeof(command)); + memset(command, 0, BUFSIZ); len = cursor = 0; break; diff --git a/shell/cmdedit.c b/shell/cmdedit.c index b94b8e3..0f064b4 100644 --- a/shell/cmdedit.c +++ b/shell/cmdedit.c @@ -414,7 +414,6 @@ extern void cmdedit_read_input(char* prompt, char command[BUFSIZ]) char c = 0; struct history *hp = his_end; - memset(command, 0, sizeof(command)); if (!reset_term) { getTermSettings(inputFd, (void*) &initial_settings); @@ -462,7 +461,7 @@ extern void cmdedit_read_input(char* prompt, char command[BUFSIZ]) xwrite(outputFd, prompt, strlen(prompt)); /* Reset the command string */ - memset(command, 0, sizeof(command)); + memset(command, 0, BUFSIZ); len = cursor = 0; break;