aboutsummaryrefslogtreecommitdiffstats
path: root/ui-log.c
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2020-01-17 15:26:09 +0100
committerFlorian Pritz <bluewind@xinu.at>2020-01-17 15:26:09 +0100
commit6c66430e9658616e118d10af9c9ab48858a04e67 (patch)
tree2e83a411ed158f151df085c7f3836827753aecf7 /ui-log.c
parent42f8840323a219d3eca59a7a2a388c3a28eeb8fb (diff)
parentfa146ccabdd0de746a7076f0630af550e43d9088 (diff)
downloadcgit-6c66430e9658616e118d10af9c9ab48858a04e67.tar.gz
cgit-6c66430e9658616e118d10af9c9ab48858a04e67.tar.xz
Merge tag 'v1.2.2' into local
CGIT v1.2.2
Diffstat (limited to 'ui-log.c')
-rw-r--r--ui-log.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ui-log.c b/ui-log.c
index d696e20..dc5cb1e 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -67,7 +67,7 @@ void show_commit_decorations(struct commit *commit)
while (deco) {
struct object_id peeled;
int is_annotated = 0;
- strncpy(buf, prettify_refname(deco->name), sizeof(buf) - 1);
+ strlcpy(buf, prettify_refname(deco->name), sizeof(buf));
switch(deco->type) {
case DECORATION_NONE:
/* If the git-core doesn't recognize it,
@@ -234,7 +234,7 @@ static void print_commit(struct commit *commit, struct rev_info *revs)
strbuf_add(&msgbuf, "\n\n", 2);
/* Place wrap_symbol at position i in info->subject */
- strcpy(info->subject + i, wrap_symbol);
+ strlcpy(info->subject + i, wrap_symbol, subject_len - i + 1);
}
}
cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head,
@@ -362,7 +362,7 @@ static char *next_token(char **src)
}
void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern,
- char *path, int pager, int commit_graph, int commit_sort)
+ const char *path, int pager, int commit_graph, int commit_sort)
{
struct rev_info rev;
struct commit *commit;
@@ -488,7 +488,7 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
for (i = 0; i < ofs && (commit = get_revision(&rev)) != NULL; /* nop */) {
if (show_commit(commit, &rev))
i++;
- free_commit_buffer(commit);
+ free_commit_buffer(the_repository->parsed_objects, commit);
free_commit_list(commit->parents);
commit->parents = NULL;
}
@@ -510,7 +510,7 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
i++;
print_commit(commit, &rev);
}
- free_commit_buffer(commit);
+ free_commit_buffer(the_repository->parsed_objects, commit);
free_commit_list(commit->parents);
commit->parents = NULL;
}