]> git.sur5r.net Git - i3/i3/blobdiff - i3bar/include/util.h
Merge pull request #2507 from stapelberg/autotools
[i3/i3] / i3bar / include / util.h
index cb0903c1e48fe5ef27b34310fa7478e8907730c4..3af79ed779c9704495b7fe400f5dacd482979420 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 */
@@ -15,7 +17,7 @@
 #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)          \
@@ -26,7 +28,7 @@
         }                \
     } while (0)
 
-/* Securely fee single-linked list */
+/* Securely free single-linked list */
 #define FREE_SLIST(l, type)              \
     do {                                 \
         type *walk = SLIST_FIRST(l);     \
@@ -37,7 +39,7 @@
         }                                \
     } while (0)
 
-/* Securely fee tail-queues */
+/* Securely free tail queue */
 #define FREE_TAILQ(l, type)                         \
     do {                                            \
         type *walk = TAILQ_FIRST(l);                \
@@ -51,7 +53,7 @@
 #if defined(DLOG)
 #undef DLOG
 #endif
-/* Use cool logging-macros */
+/* Use cool logging macros */
 #define DLOG(fmt, ...)                                                 \
     do {                                                               \
         if (config.verbose) {                                          \