diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2022-07-31 17:34:40 -0300 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2022-07-31 17:34:40 -0300 |
commit | 85d46c79c53ea73d76e5146523c09603788bcb2a (patch) | |
tree | 3ff6c0152ecc7c470c36c8ac11984f570826177a /git.c | |
parent | db9647bc5b51859d83f1e3ab299ccc03536e6cae (diff) |
git: Use `format_len()` instead of `strlen()` when creating the repo
path in `init_git()`
Diffstat (limited to 'git.c')
-rw-r--r-- | git.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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: |