[PATCH:libXmu] XmuCvtStringToCursor: sprintf -> snprintf & check for XtMalloc failure

Alan Coopersmith alan.coopersmith at oracle.com
Mon Dec 6 00:57:48 PST 2010


walter harms wrote:
> 
> Am 05.12.2010 23:53, schrieb Julien Cristau:
>> On Sun, Dec  5, 2010 at 21:43:50 +0100, walter harms wrote:
>>
>>> Can you use XFNasprintf() here ?
>>>
>> libXmu is not the X server.
>>
> 
> That does not mean not to use helper from the server side.
> Otherwise you would have to reimplement everything also in
> the libs.

Actually, yes it does, and that is exactly the effect - you
do have to reimplement everything in client libraries you want
to use there - you can't link libXmu against the Xorg binary,
which is where the XNFasprintf() is defined.

Also, this is further complicated because it uses XtMalloc/XtFree,
not malloc/free, so we'd have to write an XtAsprintf that used
XtMalloc for allocation (which might make sense if there's enough
uses in Xt code to make it worthwhile, but I've not looked for
that yet).

-- 
	-Alan Coopersmith-        alan.coopersmith at oracle.com
	 Oracle Solaris Platform Engineering: X Window System



More information about the xorg-devel mailing list