mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-08 17:50:10 +00:00
undo: fix off-by-one when prepending to inline string
This fixes the conditional in istring_prepend() to match other uses, notably to match istring_append(). Fixes #6684
This commit is contained in:
parent
a8fcde11de
commit
d3c20c3269
@ -117,7 +117,7 @@ static inline void
|
||||
istring_prepend (IString *str,
|
||||
IString *other)
|
||||
{
|
||||
if G_LIKELY (str->n_bytes + other->n_bytes < sizeof str->u.buf - 1)
|
||||
if G_LIKELY (str->n_bytes + other->n_bytes <= (sizeof str->u.buf - 1))
|
||||
{
|
||||
memmove (str->u.buf + other->n_bytes, str->u.buf, str->n_bytes);
|
||||
memcpy (str->u.buf, other->u.buf, other->n_bytes);
|
||||
|
Loading…
Reference in New Issue
Block a user