This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] print length in strrchr benchtest
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: Rajalakshmi Srinivasaraghavan <raji at linux dot vnet dot ibm dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Wed, 19 Feb 2014 12:47:07 +0100
- Subject: Re: [PATCH] print length in strrchr benchtest
- Authentication-results: sourceware.org; auth=none
- References: <1392795681-6788-1-git-send-email-raji at linux dot vnet dot ibm dot com>
On Wed, Feb 19, 2014 at 01:41:21AM -0600, Rajalakshmi Srinivasaraghavan wrote:
> The return criteria of strrchr() is to read till NULL even if the
> search character is hit.So its better to print len instead of pos.
>
> benchtests/bench-strrchr.c : print length instead of position
>
> Signed-off-by: Rajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com>
> ---
> benchtests/bench-strrchr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/benchtests/bench-strrchr.c b/benchtests/bench-strrchr.c
> index adcedde..3d42236 100644
> --- a/benchtests/bench-strrchr.c
> +++ b/benchtests/bench-strrchr.c
> @@ -122,7 +122,7 @@ do_test (size_t align, size_t pos, size_t len, int seek_char, int max_char)
> else
> result = NULL;
>
> - printf ("Length %4zd, alignment in bytes %2zd:", pos, align * sizeof(CHAR));
> + printf ("Length %4zd, alignment in bytes %2zd:", len, align * sizeof(CHAR));
>
looksok.