check: Use g_strcmp0 instead of strcmp
authorEdward Hervey <bilboed@bilboed.com>
Mon, 30 Aug 2010 10:47:31 +0000 (12:47 +0200)
committerEdward Hervey <bilboed@bilboed.com>
Mon, 30 Aug 2010 10:48:40 +0000 (12:48 +0200)
Avoids segfaults when using NULL arguments.

libs/gst/check/gstcheck.h

index 3e84b84..b746371 100644 (file)
@@ -187,7 +187,7 @@ G_STMT_START {                                                              \
 G_STMT_START {                                                      \
   const gchar * first = a;                                          \
   const gchar * second = b;                                         \
-  fail_unless(strcmp (first, second) == 0,                          \
+  fail_unless(g_strcmp0 (first, second) == 0,                          \
     "'" #a "' (%s) is not equal to '" #b"' (%s)", first, second);   \
 } G_STMT_END;
 /**