summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2017-09-26 11:16:33 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2017-09-26 11:16:33 +0000
commit65d4f317ea976de1f2d6c3e7e62e6135d26f2173 (patch)
tree1b8a116c2a129c84d5178ca5e0f740aa25d525eb /usr.bin
parent89b859e39add7404330a64dc26019791985af9cd (diff)
downloadsrc-test2-65d4f317ea976de1f2d6c3e7e62e6135d26f2173.tar.gz
src-test2-65d4f317ea976de1f2d6c3e7e62e6135d26f2173.zip
Notes
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/calendar/events.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/usr.bin/calendar/events.c b/usr.bin/calendar/events.c
index d6f358a472b7..e53dbe8d3b08 100644
--- a/usr.bin/calendar/events.c
+++ b/usr.bin/calendar/events.c
@@ -86,12 +86,9 @@ event_continue(struct event *e, char *txt)
errx(1, "event_continue: cannot allocate memory");
free(e->text);
- e->text = (char *)malloc(strlen(text) + strlen(txt) + 3);
+ asprintf(&e->text, "%s\n%s", text, txt);
if (e->text == NULL)
errx(1, "event_continue: cannot allocate memory");
- strcpy(e->text, text);
- strcat(e->text, "\n");
- strcat(e->text, txt);
free(text);
return;