From 4d199c8f9a86f4188b6862786199c62648e1525a Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Thu, 16 Apr 2009 00:35:48 +0000 Subject: A load of c89 compatibility fixes. GCC 2.95 doesn't understand -Wno-unused-parameter svn path=/trunk/hubbub/; revision=7103 --- test/tokeniser3.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/tokeniser3.c') diff --git a/test/tokeniser3.c b/test/tokeniser3.c index 95a5cbc..70e1e53 100644 --- a/test/tokeniser3.c +++ b/test/tokeniser3.c @@ -146,14 +146,14 @@ void run_test(context *ctx) if (ctx->last_start_tag != NULL) { /* Fake up a start tag, in PCDATA state */ - uint8_t buf [strlen(ctx->last_start_tag) + 3]; + size_t len = strlen(ctx->last_start_tag) + 3; + uint8_t *buf = alloca(len); - snprintf((char *) buf, sizeof buf, "<%s>", + snprintf((char *) buf, len, "<%s>", ctx->last_start_tag); assert(parserutils_inputstream_append(stream, - buf, strlen(ctx->last_start_tag) + 2) == - HUBBUB_OK); + buf, len - 1) == HUBBUB_OK); assert(hubbub_tokeniser_run(tok) == HUBBUB_OK); } -- cgit v1.2.3