aboutsummaryrefslogtreecommitdiffstats
path: root/ui-log.c
diff options
context:
space:
mode:
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;
}