diff --git a/interface/vcos/pthreads/vcos_pthreads.c b/interface/vcos/pthreads/vcos_pthreads.c index 77ce58c2c..2e0ad3c5f 100644 --- a/interface/vcos/pthreads/vcos_pthreads.c +++ b/interface/vcos/pthreads/vcos_pthreads.c @@ -306,7 +306,7 @@ void vcos_vlog_default_impl(const VCOS_LOG_CAT_T *cat, VCOS_LOG_LEVEL_T _level, #endif if(NULL != log_fhandle) { - if (cat->flags.want_prefix) + if (cat->flags.want_prefix && cat->name) fprintf( log_fhandle, "%s: ", cat->name ); vfprintf(log_fhandle, fmt, args); fputs("\n", log_fhandle); diff --git a/interface/vcos/vcos_logging.h b/interface/vcos/vcos_logging.h index a2f9fe08d..1bbf111d9 100644 --- a/interface/vcos/vcos_logging.h +++ b/interface/vcos/vcos_logging.h @@ -231,8 +231,8 @@ void vcos_log_dump_mem_impl( const VCOS_LOG_CAT_T *cat, # if !defined(AMPUTATE_ALL_VCOS_LOGGING) && (!defined(NDEBUG) || defined(VCOS_ALWAYS_WANT_LOGGING)) # define VCOS_LOGGING_ENABLED -# define _VCOS_LOG_X(cat, _level, fmt...) do { if (vcos_is_log_enabled(cat,_level)) vcos_log_impl(cat,_level,fmt); } while (0) -# define _VCOS_VLOG_X(cat, _level, fmt, ap) do { if (vcos_is_log_enabled(cat,_level)) vcos_vlog_impl(cat,_level,fmt,ap); } while (0) +# define _VCOS_LOG_X(cat, _level, fmt...) do { if (vcos_is_log_enabled(cat,_level) && NULL != cat) vcos_log_impl(cat,_level,fmt); } while (0) +# define _VCOS_VLOG_X(cat, _level, fmt, ap) do { if (vcos_is_log_enabled(cat,_level) && NULL != cat) vcos_vlog_impl(cat,_level,fmt,ap); } while (0) # else # define _VCOS_LOG_X(cat, _level, fmt...) (void)0 # define _VCOS_VLOG_X(cat, _level, fmt, ap) (void)0 diff --git a/interface/vmcs_host/linux/vcfilesys.c b/interface/vmcs_host/linux/vcfilesys.c index 9f3ebf159..446326e20 100644 --- a/interface/vmcs_host/linux/vcfilesys.c +++ b/interface/vmcs_host/linux/vcfilesys.c @@ -1016,7 +1016,8 @@ int64_t vc_hostfs_totalspace64(const char *inPath) } } - DEBUG_MINOR( "vc_hostfs_totalspace for '%s' returning %" PRId64 "", path, ret ); + if (path) + DEBUG_MINOR( "vc_hostfs_totalspace for '%s' returning %" PRId64 "", path, ret ); if (path) free( path );