forked from GitHub/gf-core
bugfix in the strings library from the C runtime
This commit is contained in:
@@ -47,9 +47,8 @@ gu_utf8_string(const uint8_t* buf, size_t sz, GuPool* pool)
|
|||||||
p = gu_malloc_aligned(pool, 1 + sz, 2);
|
p = gu_malloc_aligned(pool, 1 + sz, 2);
|
||||||
p[0] = (uint8_t) sz;
|
p[0] = (uint8_t) sz;
|
||||||
} else {
|
} else {
|
||||||
uint8_t* p =
|
p = gu_malloc_prefixed(pool, gu_alignof(size_t),
|
||||||
gu_malloc_prefixed(pool, gu_alignof(size_t),
|
sizeof(size_t), 1, 1 + sz);
|
||||||
sizeof(size_t), 1, 1 + sizeof(sz));
|
|
||||||
((size_t*) p)[-1] = sz;
|
((size_t*) p)[-1] = sz;
|
||||||
p[0] = 0;
|
p[0] = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user