Mercurial > pidgin
comparison src/gtkdebug.c @ 13926:756c3d7177d9
[gaim-migrate @ 16445]
Fix a crash bug on some systems (mostly amd64) caused by using a va_list
twice. My bad! Thanks to Kevin Stange and Vincent Ho for noticing this
and suggesting the cause. Vincent's IRC handle reminds me of a Harvey
Danger song.
committer: Tailor Script <tailor@pidgin.im>
| author | Mark Doliner <mark@kingant.net> |
|---|---|
| date | Thu, 06 Jul 2006 09:21:57 +0000 |
| parents | b76c6de0c3b5 |
| children | 8bda65b88e49 |
comparison
equal
deleted
inserted
replaced
| 13925:60f39c405dff | 13926:756c3d7177d9 |
|---|---|
| 929 } | 929 } |
| 930 } | 930 } |
| 931 | 931 |
| 932 static void | 932 static void |
| 933 gaim_gtk_debug_print(GaimDebugLevel level, const char *category, | 933 gaim_gtk_debug_print(GaimDebugLevel level, const char *category, |
| 934 const char *format, va_list args) | 934 const char *arg_s) |
| 935 { | 935 { |
| 936 #ifdef HAVE_REGEX_H | 936 #ifdef HAVE_REGEX_H |
| 937 GtkTreeIter iter; | 937 GtkTreeIter iter; |
| 938 #endif /* HAVE_REGEX_H */ | 938 #endif /* HAVE_REGEX_H */ |
| 939 gboolean timestamps; | 939 gboolean timestamps; |
| 940 gchar *arg_s, *ts_s; | 940 gchar *ts_s; |
| 941 gchar *esc_s, *cat_s, *tmp, *s; | 941 gchar *esc_s, *cat_s, *tmp, *s; |
| 942 | 942 |
| 943 if (!gaim_prefs_get_bool("/gaim/gtk/debug/enabled") || | 943 if (!gaim_prefs_get_bool("/gaim/gtk/debug/enabled") || |
| 944 (debug_win == NULL)) | 944 (debug_win == NULL)) |
| 945 { | 945 { |
| 946 return; | 946 return; |
| 947 } | 947 } |
| 948 | 948 |
| 949 timestamps = gaim_prefs_get_bool("/core/debug/timestamps"); | 949 timestamps = gaim_prefs_get_bool("/core/debug/timestamps"); |
| 950 | |
| 951 arg_s = g_strdup_vprintf(format, args); | |
| 952 | 950 |
| 953 /* | 951 /* |
| 954 * For some reason we only print the timestamp if category is | 952 * For some reason we only print the timestamp if category is |
| 955 * not NULL. Why the hell do we do that? --Mark | 953 * not NULL. Why the hell do we do that? --Mark |
| 956 */ | 954 */ |
| 968 cat_s = g_strdup(""); | 966 cat_s = g_strdup(""); |
| 969 else | 967 else |
| 970 cat_s = g_strdup_printf("<b>%s:</b> ", category); | 968 cat_s = g_strdup_printf("<b>%s:</b> ", category); |
| 971 | 969 |
| 972 esc_s = g_markup_escape_text(arg_s, -1); | 970 esc_s = g_markup_escape_text(arg_s, -1); |
| 973 | |
| 974 g_free(arg_s); | |
| 975 | 971 |
| 976 s = g_strdup_printf("<font color=\"%s\">%s%s%s</font>", | 972 s = g_strdup_printf("<font color=\"%s\">%s%s%s</font>", |
| 977 debug_fg_colors[level], ts_s, cat_s, esc_s); | 973 debug_fg_colors[level], ts_s, cat_s, esc_s); |
| 978 | 974 |
| 979 g_free(ts_s); | 975 g_free(ts_s); |
