summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
Diffstat (limited to 'builtin')
-rw-r--r--builtin/apply.c2
-rw-r--r--builtin/show-branch.c6
2 files changed, 5 insertions, 3 deletions
diff --git a/builtin/apply.c b/builtin/apply.c
index 54aba4e..4aa53f7 100644
--- a/builtin/apply.c
+++ b/builtin/apply.c
@@ -785,7 +785,7 @@ static int guess_p_value(const char *nameline)
}
/*
- * Does the ---/+++ line has the POSIX timestamp after the last HT?
+ * Does the ---/+++ line have the POSIX timestamp after the last HT?
* GNU diff puts epoch there to signal a creation/deletion event. Is
* this such a timestamp?
*/
diff --git a/builtin/show-branch.c b/builtin/show-branch.c
index c87c46e..408ce70 100644
--- a/builtin/show-branch.c
+++ b/builtin/show-branch.c
@@ -730,7 +730,6 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
if (reflog) {
struct object_id oid;
- char nth_desc[256];
char *ref;
int base = 0;
unsigned int flags = 0;
@@ -769,6 +768,7 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
for (i = 0; i < reflog; i++) {
char *logmsg;
+ char *nth_desc;
const char *msg;
unsigned long timestamp;
int tz;
@@ -788,8 +788,10 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
DATE_MODE(RELATIVE)),
msg);
free(logmsg);
- sprintf(nth_desc, "%s@{%d}", *av, base+i);
+
+ nth_desc = xstrfmt("%s@{%d}", *av, base+i);
append_ref(nth_desc, &oid, 1);
+ free(nth_desc);
}
free(ref);
}