From f41294ed836a1eaa49f125aea9d95e4e35ad3844 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Thu, 18 Feb 2021 17:04:46 -0500 Subject: [PATCH] Clean-up: lttng: replace manual string comparison code by strcasecmp MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémie Galarneau Change-Id: I7ce19e29751301513ccab9fdca53689207b71ef1 --- src/bin/lttng/loglevel.c | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/src/bin/lttng/loglevel.c b/src/bin/lttng/loglevel.c index e59c24813..9f65df006 100644 --- a/src/bin/lttng/loglevel.c +++ b/src/bin/lttng/loglevel.c @@ -7,6 +7,7 @@ #include "loglevel.h" #include +#include #include #include @@ -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 -- 2.34.1