aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/event-parse.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/event-parse.c b/src/event-parse.c
index 2c38fe5..b625621 100644
--- a/src/event-parse.c
+++ b/src/event-parse.c
@@ -1232,9 +1232,11 @@ static enum tep_event_type __read_token(struct tep_handle *tep, char **tok)
switch (type) {
case TEP_EVENT_NEWLINE:
case TEP_EVENT_DELIM:
- if (asprintf(tok, "%c", ch) < 0)
+ *tok = malloc(2);
+ if (!*tok)
return TEP_EVENT_ERROR;
-
+ (*tok)[0] = ch;
+ (*tok)[1] = '\0';
return type;
case TEP_EVENT_OP: