From 0e3cd129ae917ad0c742009c40f3aca0cc3e116d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=3D=3FUTF-8=3FB=3F6ZmI5p6X6aOe=3F=3D?= Date: Sun, 24 Jan 2016 12:54:32 -0600 Subject: [PATCH] Fix some issues with strcasecmp() conditional compilation and with memccpy() return value --- libc/string/lib_memccpy.c | 6 +----- libc/string/lib_strcasecmp.c | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/libc/string/lib_memccpy.c b/libc/string/lib_memccpy.c index bbb307afc6..2201870911 100644 --- a/libc/string/lib_memccpy.c +++ b/libc/string/lib_memccpy.c @@ -81,16 +81,12 @@ FAR void *memccpy(FAR void *s1, FAR const void *s2, int c, size_t n) /* Did we just copy the terminating byte c? */ - if (*pout == (unsigned char)c) + if (*pout++ == (unsigned char)c) { /* Yes return a pointer to the byte after the copy of c into s1 */ return (FAR void *)pout; } - - /* No increment to the next destination location */ - - pout++; } /* C was not found in the first n bytes of s2 */ diff --git a/libc/string/lib_strcasecmp.c b/libc/string/lib_strcasecmp.c index 9017625b2a..5fa3e28914 100644 --- a/libc/string/lib_strcasecmp.c +++ b/libc/string/lib_strcasecmp.c @@ -46,7 +46,7 @@ * Public Functions ****************************************************************************/ -#ifndef CONFIG_ARCH_STRCMP +#ifndef CONFIG_ARCH_STRCASECMP int strcasecmp(FAR const char *cs, FAR const char *ct) { int result;