Hi, Sorry for the delay in my reply. getchar() function is now working properly. There was some issue with microblaze read function in libgloss directory. read function was returning one extra byte due to which it was failing. I have adjusted the read function return value, then getchar was working properly. Thank you for your replies. Thanks, Nagaraju On Fri, Jul 29, 2011 at 12:28 PM, Jeremy Hall <gcc.hall@xxxxxxxxx> wrote: > You might want to add > > buf[j] = '\0'; > > after the loop. >