Skip to content

Commit

Permalink
Merge pull request #117 from VisorFolks/quick_fix_stdin
Browse files Browse the repository at this point in the history
<STDIN> Updated getch
  • Loading branch information
akashkollipara authored Feb 19, 2022
2 parents 2c76643 + 5dc5f6f commit 5e26a22
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/lib/libc/scanf.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,20 @@

#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <status.h>
#include <driver/console.h>
#include <ccpfs.h>
#include <stdio.h>
#include <stddev.h>

int __fgetc(const FILE *dev, char *c)
{
return ccpdfs_read(dev, c);
}

char getch()
{
char c;
console_getc(&c);
__fgetc(stdin, &c);
return c;
}

Expand All @@ -30,7 +36,7 @@ char getchar()
temp = getch();
if(c == 0)
c = temp;
console_putc(temp);
fputc(stdout, temp);
}
while(temp != '\r');
return c;
Expand Down

0 comments on commit 5e26a22

Please sign in to comment.