/* * Copyright (C) 2013 Freie Universität Berlin * * This file 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 */ #include #include 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)); } /** * @} */