summaryrefslogtreecommitdiffstats
path: root/src/afb-trace.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/afb-trace.c')
-rw-r--r--src/afb-trace.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/afb-trace.c b/src/afb-trace.c
index 802015fa..0de78da5 100644
--- a/src/afb-trace.c
+++ b/src/afb-trace.c
@@ -67,7 +67,7 @@
/* struct for tags */
struct tag {
struct tag *next; /* link to the next */
- char tag[1]; /* name of the tag */
+ char tag[]; /* name of the tag */
};
/* struct for events */
@@ -1073,7 +1073,7 @@ static struct tag *trace_get_tag(struct afb_trace *trace, const char *name, int
if (!tag && alloc) {
/* creation if needed */
- tag = malloc(sizeof * tag + strlen(name));
+ tag = malloc(sizeof * tag + 1 + strlen(name));
if (tag) {
strcpy(tag->tag, name);
tag->next = trace->tags;