[ostree/easy-fixes: 3/4] ostree: avoid a segfault



commit f3d4f3ab8c4bb652e952dde44e8cf896098460d7
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat May 5 20:59:23 2012 -0400

    ostree: avoid a segfault
    
    When running ostree --repo=/ostree/repo without further arguments,
    we end up calling strcmp with one argument being NULL.

 src/ostree/ot-main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/ostree/ot-main.c b/src/ostree/ot-main.c
index f328faf..3bdc4b3 100644
--- a/src/ostree/ot-main.c
+++ b/src/ostree/ot-main.c
@@ -140,7 +140,7 @@ ostree_main (int    argc,
   builtin = builtins;
   while (builtin->name)
     {
-      if (strcmp (cmd, builtin->name) == 0)
+      if (g_strcmp0 (cmd, builtin->name) == 0)
         break;
       builtin++;
     }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]