printf("fooWhen c was a carriage return; the log line obtained was
: skipped '%c'\n", c);
'oo: skipped 'This was because carriage return takes the current position to the beginning of the line. Now, as the linux console is cooked by default [Most *nix programs get their tty input via the kernel tty driver in `cooked' mode
.], it formatted the whole line and printed the line at once producing the effect.
A simple way to detect parts where the "cooked" console interferes is to run the command from within emacs. Emacs does its own input handling and is not cooked. The same log line in emacs is shown as:
foo: skipped '^M'
These petty issues must be kept in mind while considering portability of software.