X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=lib%2Fstring.c;h=09dfae03c247554deb48c29ce98693ffd9c25f9d;hb=714afa64f3d81a660715b61785f1f3a3b986f852;hp=2c4f0ec9a11f8e7219b9c5d40659616bf4bc6aaf;hpb=9023ae305919d0aecb4a22726b9d08c6b08189d7;p=u-boot diff --git a/lib/string.c b/lib/string.c index 2c4f0ec9a1..09dfae03c2 100644 --- a/lib/string.c +++ b/lib/string.c @@ -21,14 +21,13 @@ #include -#if 0 /* not used - was: #ifndef __HAVE_ARCH_STRNICMP */ /** - * strnicmp - Case insensitive, length-limited string comparison + * strncasecmp - Case insensitive, length-limited string comparison * @s1: One string * @s2: The other string * @len: the maximum number of characters to compare */ -int strnicmp(const char *s1, const char *s2, size_t len) +int strncasecmp(const char *s1, const char *s2, size_t len) { /* Yes, Virginia, it had better be unsigned */ unsigned char c1, c2; @@ -52,7 +51,16 @@ int strnicmp(const char *s1, const char *s2, size_t len) } return (int)c1 - (int)c2; } -#endif + +/** + * strcasecmp - Case insensitive string comparison + * @s1: One string + * @s2: The other string + */ +int strcasecmp(const char *s1, const char *s2) +{ + return strncasecmp(s1, s2, -1U); +} char * ___strtok;