Fix some stupid memory bugs.
authorEric Andersen <andersen@codepoet.org>
Fri, 14 Jul 2000 01:13:37 +0000 (01:13 -0000)
committerEric Andersen <andersen@codepoet.org>
Fri, 14 Jul 2000 01:13:37 +0000 (01:13 -0000)
 -Erik

cmdedit.c
shell/cmdedit.c

index b94b8e331d29e6b064154668472fdf7e707c6e4a..0f064b4147d5ae03a9a002c698bdf0cfb0e496c6 100644 (file)
--- 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;
index b94b8e331d29e6b064154668472fdf7e707c6e4a..0f064b4147d5ae03a9a002c698bdf0cfb0e496c6 100644 (file)
@@ -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;