Hi,

in boot, we have an off-by-one error in readline.  When the user ends
input with enter, the string will be ended twice, like:

    p[1] = *p = '\0';

Comparing readline with read_conf (reading commands from file),
there is no need to "double end" the input line.


Tobias

Index: cmd.c
===================================================================
RCS file: /cvs/src/sys/stand/boot/cmd.c,v
retrieving revision 1.61
diff -u -p -r1.61 cmd.c
--- cmd.c       23 Dec 2013 23:32:40 -0000      1.61
+++ cmd.c       26 Jun 2014 18:55:02 -0000
@@ -283,7 +283,7 @@ readline(char *buf, size_t n, int to)
                        continue;
                case '\n':
                case '\r':
-                       p[1] = *p = '\0';
+                       *p = '\0';
                        break;
                case '\b':
                case '\177':

Reply via email to