summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--test/cscodec-utf16.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index efadc0d..894f10d 100644
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,7 @@
# Component settings
COMPONENT := parserutils
-COMPONENT_VERSION := 0.2.2
+COMPONENT_VERSION := 0.2.3
# Default to a static library
COMPONENT_TYPE ?= lib-static
diff --git a/test/cscodec-utf16.c b/test/cscodec-utf16.c
index 835c65e..a49a710 100644
--- a/test/cscodec-utf16.c
+++ b/test/cscodec-utf16.c
@@ -87,6 +87,7 @@ int main(int argc, char **argv)
run_test(&ctx);
free(ctx.buf);
+ free(ctx.exp);
parserutils_charset_codec_destroy(ctx.codec);
@@ -117,7 +118,7 @@ bool handle_line(const char *data, size_t datalen, void *pw)
if (ctx->buf[ctx->bufused - 1] == '\n')
ctx->bufused -= 1;
- if (ctx->exp[ctx->expused - 1] == '\n')
+ if (ctx->expused != 0 && ctx->exp[ctx->expused - 1] == '\n')
ctx->expused -= 1;
run_test(ctx);