kdbgstream::operator<<({,u}char)

Stephan Kulow coolo at kde.org
Tue Nov 12 13:34:34 GMT 2002


Am Tuesday 12 November 2002 13:57 schrieb Michael Matz:
> Hi,
>
> On Tue, 12 Nov 2002, Marc Mutz wrote:
> > <snip>
> >
> > > if you add a check for 0 and '\n' (to flush) I agree and would
> > > suggest you commit it
> >
> > <snip>
> >
> > What should it output for 0? "(NULL)" or "\\0" or nothing?
> >
> > The attched patch outputs \0 (literally).
>
> sigh.  Again such ugly debug routines.  Before printing a character
> uninterpreted to the console it should be tested for printability.  If
> they aren't printable I suggest something like "\xAB" for AB being the
> hexcode of the character.  See isprint(3).
>
Hmm, might make sense. Marc - already regretting? :)

But the advantage is that you could replace == 0 with !isprint. 

Greetings, Stephan





More information about the kde-core-devel mailing list