I've been running into some unexpected behavior, mainly with fdisk.
Specifically, the issue is that the prompt is sometimes not written until
after I enter a response; then, I might get two prompts at once.  
When I looked at the code, the prompt was output using xprintf before
anything was read.

I added an fflush() after the xprintf and it solved the issue.
So I'm wondering:
If we want to make sure that a call to printf() succeeds, 
wouldn't it make sense to make sure that it writes its output at that time?
The way to do this would be calling fflush() in xprintf().

Thanks,
Isaac Dunham
_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to