summaryrefslogtreecommitdiff
path: root/test/tokeniser3.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-04-16 00:35:48 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-04-16 00:35:48 +0000
commit4d199c8f9a86f4188b6862786199c62648e1525a (patch)
tree8e7400360dd677b54229c57a40d7899f84e794b3 /test/tokeniser3.c
parent8f025108a574602e50d1090204ba30cf68047f54 (diff)
downloadlibhubbub-4d199c8f9a86f4188b6862786199c62648e1525a.tar.gz
libhubbub-4d199c8f9a86f4188b6862786199c62648e1525a.tar.bz2
A load of c89 compatibility fixes.
GCC 2.95 doesn't understand -Wno-unused-parameter svn path=/trunk/hubbub/; revision=7103
Diffstat (limited to 'test/tokeniser3.c')
-rw-r--r--test/tokeniser3.c8
1 files changed, 4 insertions, 4 deletions
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);
}