mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-29 19:10:03 +01:00
gstring: Avoid warnings from inline functions
The current code for g_string_append_c_inline generates warnings when used, with -Wnull-dereference. Avoid that.
This commit is contained in:
parent
964ecf5ec9
commit
d9f8d73be2
@ -187,7 +187,8 @@ static inline GString*
|
||||
g_string_append_c_inline (GString *gstring,
|
||||
gchar c)
|
||||
{
|
||||
if (G_LIKELY (gstring->len + 1 < gstring->allocated_len))
|
||||
if (G_LIKELY (gstring != NULL &&
|
||||
gstring->len + 1 < gstring->allocated_len))
|
||||
{
|
||||
gstring->str[gstring->len++] = c;
|
||||
gstring->str[gstring->len] = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user