Use getchar/putchar instead of readchar/base_putchar

This commit is contained in:
Michal Sieron 2021-07-29 12:18:41 +02:00
parent ead3f8b2e0
commit 768961ec59
4 changed files with 7 additions and 7 deletions

View file

@ -54,15 +54,15 @@ static int read_key(void)
{
char c;
char esc[5];
c = readchar();
c = getchar();
if (c == 27) {
int i = 0;
esc[i++] = readchar();
esc[i++] = readchar();
esc[i++] = getchar();
esc[i++] = getchar();
if (isdigit(esc[1])) {
while(1) {
esc[i] = readchar();
esc[i] = getchar();
if (esc[i++] == '~')
break;
if (i == ARRAY_SIZE(esc))

View file

@ -22,7 +22,7 @@ int readline(char *s, int size)
c[1] = 0;
ptr = 0;
while(1) {
c[0] = readchar();
c[0] = getchar();
if (c[0] == skip)
continue;
skip = 0;

View file

@ -59,7 +59,7 @@ void donut(void) {
R(5, 7, cA, sA);
R(5, 8, cB, sB);
if (readchar_nonblock()) {
readchar();
getchar();
break;
}
fputs("\x1b[23A", stdout);

View file

@ -21,7 +21,7 @@ static char *readstr(void)
static int ptr = 0;
if(readchar_nonblock()) {
c[0] = readchar();
c[0] = getchar();
c[1] = 0;
switch(c[0]) {
case 0x7f: