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/tree.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test/tree.c') diff --git a/test/tree.c b/test/tree.c index 85fd21a..d8319e6 100644 --- a/test/tree.c +++ b/test/tree.c @@ -91,7 +91,7 @@ static int run_test(int argc, char **argv, unsigned int CHUNK_SIZE) hubbub_parser_optparams params; FILE *fp; size_t len, origlen; - uint8_t *buf = alloca(CHUNK_SIZE); + uint8_t *buf = malloc(CHUNK_SIZE); const char *charset; hubbub_charset_source cssource; bool passed = true; @@ -144,6 +144,8 @@ static int run_test(int argc, char **argv, unsigned int CHUNK_SIZE) fclose(fp); + free(buf); + charset = hubbub_parser_read_charset(parser, &cssource); printf("Charset: %s (from %d)\n", charset, cssource); -- cgit v1.2.3