summaryrefslogtreecommitdiff
path: root/git.c
diff options
context:
space:
mode:
Diffstat (limited to 'git.c')
-rw-r--r--git.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/git.c b/git.c
index da9386d..7b2fd6d 100644
--- a/git.c
+++ b/git.c
@@ -718,7 +718,7 @@ git_repo **init_git(config *cfg) {
if (entry.d_type == DT_DIR) {
/* Is the entry neither ".", nor ".."? */
if (strcmp(entry.d_name, ".") && strcmp(entry.d_name, "..")) {
- char *repo_dir = calloc(strlen(cfg->git_root) + strlen(entry.d_name) + 2, sizeof(char));
+ char *repo_dir = calloc(format_len("%s/%s", cfg->git_root, entry.d_name), sizeof(char));
/* Append the directory name to the git root. */
/* Could also do this: