summaryrefslogtreecommitdiff
path: root/userspace/cat.c
diff options
context:
space:
mode:
Diffstat (limited to 'userspace/cat.c')
-rw-r--r--userspace/cat.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/userspace/cat.c b/userspace/cat.c
index 8980546..688ebcc 100644
--- a/userspace/cat.c
+++ b/userspace/cat.c
@@ -3,13 +3,16 @@
int main()
{
+ char c;
- char buf[256];
+ printf("-- read from stderr byte by byte --\n");
while(has_data_waiting(2)){
- fread(buf,1,5,stderr); // read stderr;
- printf("[%s]\n",buf);
+ fread(&c,1,1,stderr);
+ printf("%c",c);
}
+ printf("\n-- no more data on stderr --\n");
+
return 0;
}