From 6cf13f108babe98150d8927f83ff34af5b51019e Mon Sep 17 00:00:00 2001 From: Jehan Date: Sun, 14 May 2017 20:27:36 +0200 Subject: [PATCH] test: output the test file path which we failed to open. Also properly free the string in such case. --- test/uchardet-tests.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/uchardet-tests.c b/test/uchardet-tests.c index 180ac15..b39c80c 100644 --- a/test/uchardet-tests.c +++ b/test/uchardet-tests.c @@ -100,7 +100,9 @@ main(int argc, char ** argv) { /* Error opening the test file. */ fprintf(stderr, - "uchardet-tests: error opening the test file\n"); + "uchardet-tests: error opening the test file \"%s\"\n", + filename); + free(filename); return 1; }