Commit 127f8c976d93dc27d059bde2a250815c29302c2e

Peter Hutterer 2021-03-30T08:09:37

utils: assert on streq for NULL pointers We have streq_null for that purpose Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/src/utils.h b/src/utils.h
index cd3e9b1..7557dab 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -66,6 +66,7 @@ istrncmp(const char *a, const char *b, size_t n);
 static inline bool
 streq(const char *s1, const char *s2)
 {
+    assert(s1 && s2);
     return strcmp(s1, s2) == 0;
 }