avutil/avstring: Do not print NULL

Fixes segfault
Fixes Ticket4452

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2015-06-19 15:57:32 +02:00
parent ee3ef5fda2
commit 52e02a9e59
1 changed files with 1 additions and 1 deletions

View File

@ -502,7 +502,7 @@ int main(void)
printf("Testing av_append_path_component()\n"); printf("Testing av_append_path_component()\n");
#define TEST_APPEND_PATH_COMPONENT(path, component, expected) \ #define TEST_APPEND_PATH_COMPONENT(path, component, expected) \
fullpath = av_append_path_component((path), (component)); \ fullpath = av_append_path_component((path), (component)); \
printf("%s = %s\n", fullpath, expected); \ printf("%s = %s\n", fullpath ? fullpath : "(null)", expected); \
av_free(fullpath); av_free(fullpath);
TEST_APPEND_PATH_COMPONENT(NULL, NULL, "(null)") TEST_APPEND_PATH_COMPONENT(NULL, NULL, "(null)")
TEST_APPEND_PATH_COMPONENT("path", NULL, "path"); TEST_APPEND_PATH_COMPONENT("path", NULL, "path");