mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-06-03 22:58:21 +02:00
util: use zalloc in stringbuf
zalloc() aborts on allocation failure and it's what we use everywhere else. Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1465>
This commit is contained in:
parent
2ea3fb1d13
commit
5f29257569
1 changed files with 2 additions and 2 deletions
|
|
@ -41,7 +41,7 @@ stringbuf_init(struct stringbuf *b)
|
|||
{
|
||||
b->len = 0;
|
||||
b->sz = 64;
|
||||
b->data = calloc(1, b->sz);
|
||||
b->data = zalloc(b->sz);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
|
|
@ -62,7 +62,7 @@ stringbuf_reset(struct stringbuf *b)
|
|||
static inline struct stringbuf *
|
||||
stringbuf_new(void)
|
||||
{
|
||||
struct stringbuf *b = calloc(1, sizeof(*b));
|
||||
struct stringbuf *b = zalloc(sizeof(*b));
|
||||
stringbuf_init(b);
|
||||
return b;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue