Hello James, you're perfectly right, it's such a silly bug I'm ashamed. I've fixed it in the CVS. Tell us if this also fixes the fontconfig endless loops
Regards, - David On Thu, 08 Mar 2007 05:24:04 -0500, "James Cloos" <[EMAIL PROTECTED]> said: > While further debugging the error in fontconfig I wrote about earlier, > I discovered that freetype's ft_mem_strcpyn() seems to have a bug: > > It looks like: > > ,----(freetype2/src/base/ftutil.c) > | FT_BASE_DEF( FT_Int ) > | ft_mem_strcpyn( char* dst, > | const char* src, > | FT_ULong size ) > | { > | while ( size > 1 && *src != 0 ) > | *dst++ = *src++; > | > | *dst = 0; /* always zero-terminate */ > | > | return *src != 0; > | } > `---- > > and probably is most often called by way of the macro: > > ,----(freetype2/include/freetype/internal/ftmemory.h) > | #define FT_STRCPYN( dst, src, size ) \ > | ft_mem_strcpyn( (char*)dst, (const char*)(src), (FT_ULong)(size) ) > `---- > > I suspect most users expect the same semantics as strncpy(3), in that > at most size octets are copied. It seems there needs to be a size-- > in that while loop, yes? > > -JimC > -- > James Cloos <[EMAIL PROTECTED]> OpenPGP: 1024D/ED7DAEA6 > > > _______________________________________________ > Freetype-devel mailing list > Freetype-devel@nongnu.org > http://lists.nongnu.org/mailman/listinfo/freetype-devel _______________________________________________ Freetype-devel mailing list Freetype-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/freetype-devel