[Libosinfo] [PATCH libosinfo 2/4] osinfo-detect: Replace strcmp() with g_str_equal()

Fabiano Fidêncio fidencio at redhat.com
Wed Sep 5 06:59:35 UTC 2018


https://bugzilla.redhat.com/show_bug.cgi?id=1335291

Signed-off-by: Fabiano Fidêncio <fidencio at redhat.com>
---
 tools/osinfo-detect.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/osinfo-detect.c b/tools/osinfo-detect.c
index c6fb36f..952f0ff 100644
--- a/tools/osinfo-detect.c
+++ b/tools/osinfo-detect.c
@@ -54,9 +54,9 @@ static gboolean parse_format_str(const gchar *option_name,
                                  gpointer data,
                                  GError **error)
 {
-    if (strcmp(value, FORMAT_STR_ENV) == 0)
+    if (g_str_equal(value, FORMAT_STR_ENV))
         format = OUTPUT_FORMAT_ENV;
-    else if (strcmp(value, FORMAT_STR_PLAIN) == 0)
+    else if (g_str_equal(value, FORMAT_STR_PLAIN))
         format = OUTPUT_FORMAT_PLAIN;
     else {
         g_set_error(error,
@@ -75,9 +75,9 @@ static gboolean parse_type_str(const gchar *option_name,
                                gpointer data,
                                GError **error)
 {
-    if (strcmp(value, TYPE_STR_MEDIA) == 0)
+    if (g_str_equal(value, TYPE_STR_MEDIA))
         type = URL_TYPE_MEDIA;
-    else if (strcmp(value, TYPE_STR_TREE) == 0)
+    else if (g_str_equal(value, TYPE_STR_TREE))
         type = URL_TYPE_TREE;
     else {
         g_set_error(error,
-- 
2.17.1




More information about the Libosinfo mailing list