1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-03 16:23:14 +02:00

core: return empty string for window and buffer pointers in focus hashtable when value is N/A

This commit is contained in:
Sebastien Helleu
2011-08-14 18:03:29 +02:00
parent 84d097a022
commit 1ca036e8d9
5 changed files with 17 additions and 10 deletions
+1 -1
View File
@@ -1475,7 +1475,7 @@ gui_bar_item_focus_buffer_nicklist (void *data,
window = (struct t_gui_window *)value;
if (!window)
window = gui_current_window;
return NULL;
error = NULL;
bar_item_line = (int) strtol (str_bar_item_line, &error, 10);
+10 -3
View File
@@ -52,9 +52,16 @@
snprintf (str_value, sizeof (str_value), "%ld", __time); \
hashtable_set (hashtable, __name, str_value);
#define FOCUS_PTR(__name, __pointer) \
snprintf (str_value, sizeof (str_value), \
"0x%lx", (long unsigned int)__pointer); \
hashtable_set (hashtable, __name, str_value);
if (__pointer) \
{ \
snprintf (str_value, sizeof (str_value), \
"0x%lx", (long unsigned int)__pointer); \
hashtable_set (hashtable, __name, str_value); \
} \
else \
{ \
hashtable_set (hashtable, __name, ""); \
}
/*