1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/sys/posix/strings.c
Ludwig Ortmann 2314915ff2 license: fix license header grammar
insert missing "is"
2014-05-14 09:49:09 +02:00

35 lines
755 B
C

/*
* Copyright (C) 2013 Freie Universität Berlin
*
* This file is subject to the terms and conditions of the GNU Lesser General
* Public License. See the file LICENSE in the top level directory for more
* details.
*/
/**
* @{
* @file strings.c
* @brief Providing implementation for prototypes defined in strings.h.
* @author Martin Lenders <mlenders@inf.fu-berlin.de>
*/
#include <strings.h>
#include <ctype.h>
int strncasecmp(const char *s1, const char *s2, size_t n)
{
while (n-- && tolower((unsigned char) *s1) == tolower((unsigned char) *s2)) {
if (!n && !*s1) {
break;
}
s1++;
s2++;
}
return (tolower((unsigned char) *s1) - tolower((unsigned char) *s2));
}
/**
* @}
*/