X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=tests%2Funit%2Ftest_utils_expand_path.c;h=aa7984b4026b38e4385f11d26b07545444c9bb1c;hp=1224a5cbbca994802ad77603a7d4dead127dfdb6;hb=8082d471b40e0966275515e11b8594e5e74e5eb0;hpb=1661351d4b89cad297122e8a4fe59d713ed3fda7 diff --git a/tests/unit/test_utils_expand_path.c b/tests/unit/test_utils_expand_path.c index 1224a5cbb..aa7984b40 100644 --- a/tests/unit/test_utils_expand_path.c +++ b/tests/unit/test_utils_expand_path.c @@ -15,7 +15,6 @@ * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE #include #include #include @@ -27,8 +26,7 @@ #include -#include - +#include #include /* For error.h */ @@ -313,9 +311,12 @@ static void test_utils_expand_path(void) /* Test invalid cases */ for (i = 0; i < num_invalid_tests; i++) { - sprintf(name, "invalid test case: %s", invalid_tests_inputs[i]); + const char *test_input = invalid_tests_inputs[i]; + + sprintf(name, "invalid test case: %s", test_input ? + test_input : "NULL"); - result = utils_expand_path(invalid_tests_inputs[i]); + result = utils_expand_path(test_input); if (result != NULL) { free(result); }