This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] print length in strrchr benchtest


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));
 
   FOR_EACH_IMPL (impl, 0)
     do_one_test (impl, (CHAR *) (buf + align), seek_char, result);
-- 
1.8.4


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]