summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 {