This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: A question about printf


"Lewin A.R.W. Edwards" wrote:
> 
> printf("** Found logical block %d at physical block %d ",i, k);
> }
> 
> would skip some of the last bytes of the output. However, if I added \n to
> the end of the printf format string, then all output is OK.
> 
> Looks like a buffering issue of some kind perhaps, try adding \n to the end
> of your printf strings and see if that fixes it.

This is completely correct for line-buffered output and is mandated by the
ISO C standard. There is no bug in this case.

Jifl
-- 
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS  Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow."  ||  These opinions are all my own fault

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]