Merge branch 'md/exclude-promisor-objects-fix' into maint
[gitweb.git] / builtin / init-db.c
index 4ecf90936822e64998651e4d51d1be9c921dee60..12ddda7e7bac51f74b2f7ca8a2b64ffe90fd8683 100644 (file)
@@ -73,7 +73,8 @@ static void copy_templates_1(struct strbuf *path, struct strbuf *template_path,
                        continue;
                else if (S_ISLNK(st_template.st_mode)) {
                        struct strbuf lnk = STRBUF_INIT;
-                       if (strbuf_readlink(&lnk, template_path->buf, 0) < 0)
+                       if (strbuf_readlink(&lnk, template_path->buf,
+                                           st_template.st_size) < 0)
                                die_errno(_("cannot readlink '%s'"), template_path->buf);
                        if (symlink(lnk.buf, path->buf))
                                die_errno(_("cannot symlink '%s' '%s'"),