summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2022-08-06 12:18:11 -0300
committermrb0nk500 <b0nk@b0nk.xyz>2022-08-06 12:18:11 -0300
commit83b32144799ac58c845120ef901571869a3b3bc9 (patch)
treec7426f2f6bc2571e24c5e0ec0abb18f0ba7f90c0
parent32329a4084df0a12ff0e4b3853859c778a902468 (diff)
git: Fix an issue with `get_patch_list()` not properly adding whitespace
-rw-r--r--git.c4
1 files 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 {