diff --git a/compctld.c b/compctld.c
index 45d2f348f4524cdebefd8fd9cf369f3f979b2010..25aa9177d7a8335452e46dd0ba5bb4f37a0d3abe 100644
--- a/compctld.c
+++ b/compctld.c
@@ -14,7 +14,7 @@
 #include "common.h"
 
 
-#define begins_with(s_, a_) (!strncmp(s_, a_, sizeof(a_)))
+#define begins_with(s_, a_) (!strncmp(s_, a_, sizeof(s_) - 1))
 
 
 void