forked from pepper-org/pepperOS
kheap info
This commit is contained in:
+13
-7
@@ -289,15 +289,21 @@ int keyboard_getline(char* output, size_t size)
|
||||
|
||||
// Read until Enter is pressed
|
||||
while ((c = keyboard_getchar()) != 0x0A) {
|
||||
if (index == size-1) {
|
||||
output[index] = c;
|
||||
output[index+1] = '\0';
|
||||
return index;
|
||||
if (c == '\b') {
|
||||
if (index > 0) {
|
||||
index--;
|
||||
output[index] = '\0';
|
||||
printf(" \b");
|
||||
}
|
||||
continue;
|
||||
}
|
||||
output[index] = c;
|
||||
index++;
|
||||
|
||||
if (index >= size-1) {
|
||||
continue;
|
||||
}
|
||||
output[index++] = c;
|
||||
}
|
||||
output[index+1] = '\0';
|
||||
output[index] = '\0';
|
||||
return index;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user