Skip to content

Commit 426ccd6

Browse files
author
徐扬斌
committed
GTK: fix wrong pointer value in debug logs.
1 parent 00d4cf5 commit 426ccd6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

include/wx/gtk/private/debughlp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
bool wxGtkDebugLog(const char* format, const char* function_name, int line_num, const char* src_file ...);
77

88
#define DO_GTK_DEBUG_LOG(format, ...) \
9-
wxGtkDebugLog("%s:%d:%s--->" format, __func__, __LINE__, __FILE__, __VA_ARGS__)
9+
wxGtkDebugLog(format, __func__, __LINE__, __FILE__, __VA_ARGS__)
1010

1111
#endif

src/gtk/debughlp.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ bool wxGtkDebugLog(const char* format, const char* function_name, int line_num,
99
clock_gettime(CLOCK_REALTIME, &nano_now);
1010
if (logfile_ != nullptr){
1111
va_list argptr;
12-
va_start(argptr,line_num);
13-
fprintf(logfile_, "PreciseTime:%ld,%ld. ", nano_now.tv_sec, nano_now.tv_nsec);
14-
fprintf(logfile_, format, src_file, line_num, function_name, argptr);
12+
va_start(argptr, src_file);
13+
fprintf(logfile_, "PreciseTime:%ld,%ld. %s:%d:%s--->", nano_now.tv_sec, nano_now.tv_nsec, src_file, line_num, function_name);
14+
vfprintf(logfile_, format, argptr);
1515
va_end(argptr);
1616
std::fclose(logfile_);
1717
return true;

0 commit comments

Comments
 (0)