From ff31fd617c976832422206a9d36ecd395f45cbaf Mon Sep 17 00:00:00 2001 From: "Anthony J. Bentley" Date: Fri, 26 Apr 2013 18:58:59 -0600 Subject: Don't use the nonportable alloca() during tests. --- test/tokeniser2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test/tokeniser2.c') diff --git a/test/tokeniser2.c b/test/tokeniser2.c index cf0311d..780c646 100644 --- a/test/tokeniser2.c +++ b/test/tokeniser2.c @@ -143,7 +143,7 @@ void run_test(context *ctx) if (ctx->last_start_tag != NULL) { /* Fake up a start tag, in PCDATA state */ size_t len = strlen(ctx->last_start_tag) + 3; - uint8_t *buf = alloca(len); + uint8_t *buf = malloc(len); snprintf((char *) buf, len, "<%s>", ctx->last_start_tag); @@ -152,6 +152,8 @@ void run_test(context *ctx) buf, len - 1) == HUBBUB_OK); assert(hubbub_tokeniser_run(tok) == HUBBUB_OK); + + free(buf); } if (ctx->process_cdata) { -- cgit v1.2.3