]> git.sur5r.net Git - i3/i3/blobdiff - i3bar/include/util.h
Merge branch 'release-4.16.1'
[i3/i3] / i3bar / include / util.h
index ac13799851c097d08a4c638cf53eb8dda8a44933..1f56361106dfc97670bc412bf5d6e2ad90fb6450 100644 (file)
@@ -2,11 +2,13 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  */
 #pragma once
 
+#include <config.h>
+
 #include "queue.h"
 
 /* Get the maximum/minimum of x and y */
 #undef MIN
 #define MIN(x, y) ((x) < (y) ? (x) : (y))
 
-#define STARTS_WITH(string, len, needle) ((len >= strlen(needle)) && strncasecmp(string, needle, strlen(needle)) == 0)
+#define STARTS_WITH(string, len, needle) (((len) >= strlen((needle))) && strncasecmp((string), (needle), strlen((needle))) == 0)
 
 /* Securely free p */
-#define FREE(p)          \
-    do {                 \
-        if (p != NULL) { \
-            free(p);     \
-            p = NULL;    \
-        }                \
+#define FREE(p)   \
+    do {          \
+        free(p);  \
+        p = NULL; \
     } while (0)
 
 /* Securely free single-linked list */