From: James Courtier-D. <Ja...@su...> - 2003-12-10 23:31:30
|
Frantisek Dvorak wrote: > Hi James, > > V St, 10. 12. 2003 v 21:03, James Courtier-Dutton píše: > >>Hi, >> >>I have been trying to track down a hanging bug in xine-ui. > > > Cool! I sometimes got the hang too, but it's hard to reproduce... > > >>In /src/xith/xine-tools/font.c, line 553, we have >>int xitk_font_get_text_width(xitk_font_t *xtfs, const char *c, int nbytes) { >> >>This is sometimes being called with nbytes < 1. Sometime nbytes=-1. >>Is this a valid number for nbytes to have, or is it a bug? >> > > > Yes, this is evidently a bug. > > Cheers, > Frantisek > > > > The point I was trying to make, is what are allowed values for nbytes for the calls inside xitk_font_get_text_width? I don't know X programming at all well, E.g. width = XmbTextEscapement(xtfs->fontset, c, nbytes); width = XTextWidth (xtfs->font, c, nbytes); From the "man XmbTextEscapement" it seems faily pointless to have anything other than nbytes > 0. I nbytes = 0, the result width will always be 0, and if nbytes < 0, I would think the result of that would be strange at best. What is a string of -1 length anyway! I will try the patch, and see if the hang is removed or not. Cheers James |