Merge branch 'jc/gettext-test-fix'
[gitweb.git] / dir.c
diff --git a/dir.c b/dir.c
index 1c488b52003913940b053178b8dce3a06838b0b5..ad30a5a46dd8d902874d3c3185f905c13a18ba7f 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -2756,7 +2756,7 @@ static int read_one_dir(struct untracked_cache_dir **untracked_,
        next = data + len + 1;
        if (next > rd->end)
                return -1;
-       *untracked_ = untracked = xmalloc(st_add(sizeof(*untracked), len));
+       *untracked_ = untracked = xmalloc(st_add3(sizeof(*untracked), len, 1));
        memcpy(untracked, &ud, sizeof(ud));
        memcpy(untracked->name, data, len + 1);
        data = next;