Clean-up: lttng: replace manual string comparison code by strcasecmp
[lttng-tools.git] / src / bin / lttng / loglevel.c
index e59c248131b2cc57885ff6be50eb63b4da1467e1..9f65df00664cbfb87fde03d551e5aa24dfbf3c49 100644 (file)
@@ -7,6 +7,7 @@
 
 #include "loglevel.h"
 #include <string.h>
+#include <strings.h>
 #include <ctype.h>
 #include <assert.h>
 
@@ -119,25 +120,7 @@ const struct loglevel_name_value loglevel_python_values[] = {
 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
This page took 0.031243 seconds and 4 git commands to generate.