This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v4] Replace use of snprintf with strfrom in libm tests
- From: Joseph Myers <joseph at codesourcery dot com>
- To: "Gabriel F. T. Gomes" <gftg at linux dot vnet dot ibm dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Tue, 20 Dec 2016 15:39:18 +0000
- Subject: Re: [PATCH v4] Replace use of snprintf with strfrom in libm tests
- Authentication-results: sourceware.org; auth=none
- References: <1482238851-24336-1-git-send-email-gftg@linux.vnet.ibm.com>
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