diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2022-08-06 12:18:11 -0300 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2022-08-06 12:18:11 -0300 |
commit | 83b32144799ac58c845120ef901571869a3b3bc9 (patch) | |
tree | c7426f2f6bc2571e24c5e0ec0abb18f0ba7f90c0 | |
parent | 32329a4084df0a12ff0e4b3853859c778a902468 (diff) |
git: Fix an issue with `get_patch_list()` not properly adding whitespace
-rw-r--r-- | git.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 { |