test: move an assert up to before the strlen() use ../../../test/keysym.c:80:24: warning: Null pointer passed to 1st parameter expecting 'nonnull' [core.NonNullParamChecker] (unsigned) strlen(expected)); Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
diff --git a/test/keysym.c b/test/keysym.c
index bb2ec28..3210770 100644
--- a/test/keysym.c
+++ b/test/keysym.c
@@ -76,12 +76,13 @@ test_utf8(xkb_keysym_t keysym, const char *expected)
if (ret <= 0)
return ret;
+ assert(expected != NULL);
+
fprintf(stderr, "Expected keysym %#x -> %s (%u bytes)\n", keysym, expected,
(unsigned) strlen(expected));
fprintf(stderr, "Received keysym %#x -> %s (%u bytes)\n\n", keysym, s,
(unsigned) strlen(s));
- assert(expected != NULL);
return streq(s, expected);
}