From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: [PATCH] Convert hvmloader sprintf() into snprintf() Date: Tue, 29 Nov 2011 14:10:27 +0000 Message-ID: <4ED4E7D3.2020604@citrix.com> References: <4ED4E4C1.10605@citrix.com> <291EDFCB1E9E224A99088639C4762022B5988E4F02@LONPMAILBOX01.citrite.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <291EDFCB1E9E224A99088639C4762022B5988E4F02@LONPMAILBOX01.citrite.net> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Paul Durrant Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On 29/11/11 14:03, Paul Durrant wrote: >> >> This doesn't return the correct value according the C99. From the >> snprintf() man page: >> >> "The functions snprintf() and vsnprintf() do not write more than >> size bytes (including the trailing '\0'). If the output was >> truncated due to this limit then the return value is the number of >> characters (not including the trailing '\0') which would have been >> written to the final string if enough space had been available. >> Thus, a return value of size or more means that the output >> was truncated." >> > > ...and that matters because? I didn't say anywhere that the implementation was C99 compliant. I suggest giving it a different name then. David