From 18605db3acb2f6e4b7021ba60a6803c70247cb2a Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 3 Jul 2018 17:49:57 +0100 Subject: [PATCH] Allow empty strings to be refcounted --- glib/grefstring.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/glib/grefstring.c b/glib/grefstring.c index ea15d544f..454b38dcb 100644 --- a/glib/grefstring.c +++ b/glib/grefstring.c @@ -120,7 +120,7 @@ g_ref_string_new (const char *str) char *res; gsize len; - g_return_val_if_fail (str != NULL && *str != '\0', NULL); + g_return_val_if_fail (str != NULL, NULL); len = strlen (str); @@ -171,7 +171,7 @@ g_ref_string_new_intern (const char *str) { char *res; - g_return_val_if_fail (str != NULL && *str != '\0', NULL); + g_return_val_if_fail (str != NULL, NULL); G_LOCK (interned_ref_strings); @@ -211,7 +211,7 @@ g_ref_string_new_intern (const char *str) char * g_ref_string_acquire (char *str) { - g_return_val_if_fail (str != NULL && *str != '\0', NULL); + g_return_val_if_fail (str != NULL, NULL); return g_atomic_rc_box_acquire (str); } @@ -246,7 +246,7 @@ remove_if_interned (gpointer data) void g_ref_string_release (char *str) { - g_return_if_fail (str != NULL && *str != '\0'); + g_return_if_fail (str != NULL); g_atomic_rc_box_release_full (str, remove_if_interned); } @@ -264,7 +264,7 @@ g_ref_string_release (char *str) gsize g_ref_string_length (char *str) { - g_return_val_if_fail (str != NULL && *str != '\0', 0); + g_return_val_if_fail (str != NULL, 0); return g_atomic_rc_box_get_size (str) - 1; }