Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed null ptr errors in print statements #635

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion interface/vcos/pthreads/vcos_pthreads.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions interface/vcos/vcos_logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion interface/vmcs_host/linux/vcfilesys.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down