[okl4-developer] Bug in serial input?

Andreas Rottmann a.rottmann at gmx.at
Mon Mar 8 02:10:16 EST 2010


Andreas Rottmann <a.rottmann at gmx.at> writes:

> Hi!
>
> Running this modified hello world example in skyeye 1.3.0 RC1:
>
> #include <stdio.h>
>
> int
> main(int argc, char** argv)
> {
>     char buffer[64];
>     printf("Your name please: ");
>     fgets(buffer, sizeof(buffer), stdin);
>     printf("got: %s\n", buffer);
> }
> /* --- EOF hello.c --- */
>
> ... yields on my machine:
>
> OKL4 - (provider: Open Kernel Labs) built on Mar  3 2010 20:29:39 using gcc version 3.4.4.
> Your name please: got: �������������������
> --- KD# User: L4 Rootserver exit ---
>>
>
> This is without any user input; it seems that `stdin' has some data
> buffered, and then returns EOF. Probably this is a bug my environment --
> could someone try to run this, and tell me if it works for them?
>
It seems that this indeed a bug in the OKL C library, and this patch
appears to fix it:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fixes.diff
Type: text/x-diff
Size: 518 bytes
Desc: Serial input fix
Url : http://lists.okl4.org/pipermail/developer/attachments/20100307/f89df3f3/attachment.diff 


More information about the Developer mailing list