From 02f5504de388eb69ded0bc9e05361d8db82c2137 Mon Sep 17 00:00:00 2001 From: Rupinder Singh Khokhar Date: Fri, 13 Jun 2014 05:00:11 +0530 Subject: [Fix] tokeniser wrongly emitted a replacement character instead of utf8 NULL. Also, the tester used strlen to calculate string lengths--this seg faults if a null is passed-- this is also fixed. --- test/testutils.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/testutils.h') diff --git a/test/testutils.h b/test/testutils.h index 45870f9..7a8eda5 100644 --- a/test/testutils.h +++ b/test/testutils.h @@ -10,6 +10,18 @@ #define UNUSED(x) ((x) = (x)) #endif +#ifndef LEN +uint32_t string_length(const char *str); +uint32_t string_length(const char *str) +{ + if(str == NULL) + return 0; + return strlen(str); +} +#define LEN(x) string_length(x) +#endif + + /* Redefine assert, so we can simply use the standard assert mechanism * within testcases and exit with the right output for the testrunner * to do the right thing. */ -- cgit v1.2.3