about summary refs log tree commit diff
path: root/src/regex
diff options
context:
space:
mode:
Diffstat (limited to 'src/regex')
-rw-r--r--src/regex/glob.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/regex/glob.c b/src/regex/glob.c
index 746da77d..98636295 100644
--- a/src/regex/glob.c
+++ b/src/regex/glob.c
@@ -11,7 +11,7 @@
 struct match
 {
 	struct match *next;
-	char name[1];
+	char name[];
 };
 
 static int is_literal(const char *p, int useesc)
@@ -37,7 +37,7 @@ static int is_literal(const char *p, int useesc)
 
 static int append(struct match **tail, const char *name, size_t len, int mark)
 {
-	struct match *new = malloc(sizeof(struct match) + len + 1);
+	struct match *new = malloc(sizeof(struct match) + len + 2);
 	if (!new) return -1;
 	(*tail)->next = new;
 	new->next = NULL;