[Xcb] [PATCH:xcb-util] Make sure wm_class name strings are null-terminated

Arnaud Fontaine arnaud at andesi.org
Tue Jun 15 07:47:46 PDT 2010

>>>>> Alan Coopersmith <alan.coopersmith at oracle.com> writes:

    > I don't think an assert is  a good idea - my program shouldn't die
    > because someone else's had a bug, but I was considering submitting
    > a patch that checked the  results were null terminated and if not,
    > discarded  them as an error.  If  I did that, should  there be any
    > diagnostic that this happened?  fprintf(stderr, ...) in the middle
    > of a  X library seems so  ugly, despite the huge amount  of crap I
    > get on stderr from most gtk applications.

The assert() was indeed  not a good idea ;). Why not  just `return 0'? I
know  it's far from  being ideal,  but, after  all, the  function should
simply `return 0'  if something wrong happened, no  (like reply type not
being a STRING...)

Arnaud Fontaine (arnau)

More information about the Xcb mailing list