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:
committed by
Matthias Clasen
parent
957ff91fa5
commit
4d8bb515fb
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user