projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: bt_g_hash_table_contains(): handle `NULL`/0 values
[babeltrace.git]
/
include
/
babeltrace
/
compat
/
glib-internal.h
diff --git
a/include/babeltrace/compat/glib-internal.h
b/include/babeltrace/compat/glib-internal.h
index dd03b19c8faa934f0521a4302dd1fcc2fe17bf69..fd253559e3284f9c7af4a632c8ae5331837ba350 100644
(file)
--- a/
include/babeltrace/compat/glib-internal.h
+++ b/
include/babeltrace/compat/glib-internal.h
@@
-40,14
+40,11
@@
bt_g_hash_table_contains(GHashTable *hash_table, gconstpointer key)
static inline gboolean
bt_g_hash_table_contains(GHashTable *hash_table, gconstpointer key)
{
static inline gboolean
bt_g_hash_table_contains(GHashTable *hash_table, gconstpointer key)
{
- const char *value;
+ gpointer orig_key;
+ gpointer value;
- value = g_hash_table_lookup(hash_table, key);
- if (value == NULL) {
- return FALSE;
- }
-
- return TRUE;
+ return g_hash_table_lookup_extended(hash_table, key, &orig_key,
+ &value);
}
#endif
}
#endif
This page took
0.024166 seconds
and
4
git commands to generate.