[PATCH v4] Replace use of snprintf with strfrom in libm tests

Joseph Myers joseph@codesourcery.com
Tue Dec 20 15:39:00 GMT 2016


On Tue, 20 Dec 2016, Gabriel F. T. Gomes wrote:

> +  /* Add a space to the beginning of the output string, if the floating-point
> +     number is non-negative.  This mimics the behavior of the space (' ') flag
> +     in snprintf, which is not available on strfrom.  */
> +  if (! signbit (value))
> +    {
> +      *dest = ' ';
> +      dest++;

You should also have "size--;" in here, so that the size passed to the 
strfrom function accurately reflects the size left in dest after the space 
was inserted.

The patch is OK with that change.

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Libc-alpha mailing list