From 83b32144799ac58c845120ef901571869a3b3bc9 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Sat, 6 Aug 2022 12:18:11 -0300 Subject: git: Fix an issue with `get_patch_list()` not properly adding whitespace --- git.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git.c b/git.c index e56035b..8f99f53 100644 --- a/git.c +++ b/git.c @@ -400,14 +400,14 @@ int get_patch_list(void *ctx, void *data, const keyword *key, keyword_val *val) char *tmp; for (int i = 0; pr->patches[i] != NULL; i++) { - len += format_len("% *s", !i, pr->patches[i]->name); + len += format_len("% *s", (int)strlen(pr->patches[i]->name)+(i > 0), pr->patches[i]->name); } val->str = calloc(len+1, sizeof(char)); tmp = val->str; for (int i = 0; pr->patches[i] != NULL; i++) { - tmp += sprintf(tmp, "%*s", !i, pr->patches[i]->name); + tmp += sprintf(tmp, "%*s", (int)strlen(pr->patches[i]->name)+(i > 0), pr->patches[i]->name); } return 2; } else { -- cgit v1.2.3-13-gbd6f