From 8a3a2fd2982d28e6e02baa0446d55ad28e4fbbdf Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Sat, 9 Aug 2014 15:36:00 +0200 Subject: [PATCH] Don't crash when the log callback gets a NULL mesh. --- examples/manynodes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/manynodes.c b/examples/manynodes.c index e00b80be..18299d9b 100644 --- a/examples/manynodes.c +++ b/examples/manynodes.c @@ -22,7 +22,7 @@ static void log_message(meshlink_handle_t *mesh, meshlink_log_level_t level, con [MESHLINK_ERROR] = "\x1b[31mERROR", [MESHLINK_CRITICAL] = "\x1b[31mCRITICAL", }; - fprintf(stderr, "%s\t%s:\x1b[0m %s\n", mesh->name,levelstr[level], text); + fprintf(stderr, "%s\t%s:\x1b[0m %s\n", mesh ? mesh->name : "global",levelstr[level], text); } //Test mesh sending data -- 2.39.5