Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Allocate formatted strings with git's xstrfmt
Diffstat (limited to 'source/cgit.c')
| -rw-r--r-- | source/cgit.c | 8 |
1 file changed, 4 insertions, 4 deletions
diff --git a/source/cgit.c b/source/cgit.c index e98210f..e0b6adb 100644 --- a/source/cgit.c +++ b/source/cgit.c @@ -963,7 +963,7 @@ static void parse_readme(const char *readme, char **filename, char **ref, struct } if (!(*ref) && readme[0] != '/') - *filename = cgit_fmtalloc("%s/%s", repo->path, readme); + *filename = xstrfmt("%s/%s", repo->path, readme); else *filename = xstrdup(readme); } @@ -1046,7 +1046,7 @@ static int prepare_repo_cmd(int nongit, int err, int clone) if (nongit) { const char *name = ctx.repo->name; - ctx.page.title = cgit_fmtalloc("%s - %s", ctx.cfg.root_title, "config error"); + ctx.page.title = xstrfmt("%s - %s", ctx.cfg.root_title, "config error"); ctx.repo = NULL; cgit_print_error_page( 404, "Not Found", "Failed to open %s: %s", name, @@ -1054,7 +1054,7 @@ static int prepare_repo_cmd(int nongit, int err, int clone) ); return 1; } - ctx.page.title = cgit_fmtalloc("%s - %s", ctx.repo->name, ctx.cfg.root_title); + ctx.page.title = xstrfmt("%s - %s", ctx.repo->name, ctx.cfg.root_title); if (!ctx.repo->defbranch) ctx.repo->defbranch = guess_defbranch(); @@ -1272,7 +1272,7 @@ int cmd_main(int argc, const char **argv) path++; ctx.qry.url = xstrdup(path); if (ctx.qry.raw) { - char *path_and_query = cgit_fmtalloc("%s?%s", path, ctx.qry.raw); + char *path_and_query = xstrfmt("%s?%s", path, ctx.qry.raw); free(ctx.qry.raw); ctx.qry.raw = path_and_query; } else { |
