[PATCH:setxkbmap] Use snprintf instead of trying to pre-measure sprintf result sizes.

Alan Coopersmith alan.coopersmith at oracle.com
Mon Feb 14 07:09:00 PST 2011


On 02/14/11 02:54 AM, Mark Kettenis wrote:
>> From: Alan Coopersmith <alan.coopersmith at oracle.com>
>> Date: Thu, 10 Feb 2011 00:00:11 -0800
>>
>> Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
>> ---
>>  setxkbmap.c |    7 +++----
>>  1 files changed, 3 insertions(+), 4 deletions(-)
> 
> Isn't it better to use sizeof(buf) instead of PATH_MAX?

Probably -- I'd just left that from the existing code.

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



More information about the xorg-devel mailing list