mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-11 03:46:17 +01:00
gtestutils: Drop unnecessary NULL check
The macro wrapper to `g_assertion_message_cmpstrv()` makes sure that neither array is `NULL`, so there’s no need for a second `NULL` check. Additionally, this check happens after the arrays have already been dereferenced, at which point the program would have crashed if the arrays were `NULL`. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Coverity CID: #1436406, #1436407
This commit is contained in:
parent
bb4d9e8c6d
commit
065dea99f4
@ -3055,8 +3055,8 @@ g_assertion_message_cmpstrv (const char *domain,
|
||||
const char *s1 = arg1[first_wrong_idx], *s2 = arg2[first_wrong_idx];
|
||||
char *a1, *a2, *s, *t1 = NULL, *t2 = NULL;
|
||||
|
||||
a1 = arg1 ? g_strconcat ("\"", t1 = g_strescape (s1, NULL), "\"", NULL) : g_strdup ("NULL");
|
||||
a2 = arg2 ? g_strconcat ("\"", t2 = g_strescape (s2, NULL), "\"", NULL) : g_strdup ("NULL");
|
||||
a1 = g_strconcat ("\"", t1 = g_strescape (s1, NULL), "\"", NULL);
|
||||
a2 = g_strconcat ("\"", t2 = g_strescape (s2, NULL), "\"", NULL);
|
||||
g_free (t1);
|
||||
g_free (t2);
|
||||
s = g_strdup_printf ("assertion failed (%s): first differing element at index %" G_GSIZE_FORMAT ": %s does not equal %s",
|
||||
|
Loading…
Reference in New Issue
Block a user