Merge pull request #25783 from keszybz/trivial-cleanups

Trivial cleanups
This commit is contained in:
Lennart Poettering
2022-12-19 17:01:51 +01:00
committed by GitHub
4 changed files with 10 additions and 18 deletions
+3 -3
View File
@@ -84,12 +84,12 @@ static inline void *xmalloc_multiply(size_t size, size_t n) {
/* Use malloc attribute as this never returns p like userspace realloc. */
_malloc_ _alloc_(3) _returns_nonnull_ _warn_unused_result_
static inline void *xrealloc(void *p, size_t old_size, size_t new_size) {
void *r = xmalloc(new_size);
void *t = xmalloc(new_size);
new_size = MIN(old_size, new_size);
if (new_size > 0)
memcpy(r, p, new_size);
memcpy(t, p, new_size);
free(p);
return r;
return t;
}
#define xpool_print(fmt, ...) ((char16_t *) ASSERT_SE_PTR(PoolPrint((fmt), ##__VA_ARGS__)))