Sanitize vcoreid from untrusted sources
[akaros.git] / kern / src / readline.c
index 32548a6..7fc1051 100644 (file)
@@ -31,11 +31,13 @@ int readline(char *buf, size_t buf_l, const char *prompt, ...)
                        }
                        continue;
                } else if (c == '\n' || c == '\r') {
-                       /* sending a \n regardless, since the serial port gives us a \r for
-                        * carriage returns. (probably won't get a \r anymore) */
+                       /* sending a \n regardless, since the serial port gives
+                        * us a \r for carriage returns. (probably won't get a
+                        * \r anymore) */
                        if (echoing)
                                cputchar('\n');
-                       assert(i <= buf_l - 1); /* never write to buf_l - 1 til the end */
+                       assert(i <= buf_l - 1);
+                       /* never write to buf_l - 1 til the end */
                        buf[i++] = c;
                        retval =  i;
                        break;