Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I7ce19e29751301513ccab9fdca53689207b71ef1
#include "loglevel.h"
#include <string.h>
+#include <strings.h>
#include <ctype.h>
#include <assert.h>
static
bool string_equal_insensitive(const char *a, const char *b)
{
- bool result;
-
- assert(a && b);
-
- while (*a && *b) {
- if (toupper(*a) != toupper(*b)) {
- result = false;
- goto end;
- }
-
- a++;
- b++;
- }
-
- /* If a and b don't have the same length, consider them unequal. */
- result = *a == *b;
-
-end:
- return result;
+ return strcasecmp(a, b) == 0;
}
static