mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-20 15:00:05 +01:00
util: use already computed strlen v2
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1252>
This commit is contained in:
parent
8ab0e53812
commit
812bcd68f7
1 changed files with 3 additions and 3 deletions
|
|
@ -150,12 +150,12 @@ stringbuf_append_from_fd(struct stringbuf *b, int fd, size_t maxlen)
|
||||||
static inline int
|
static inline int
|
||||||
stringbuf_append_string(struct stringbuf *b, const char *msg)
|
stringbuf_append_string(struct stringbuf *b, const char *msg)
|
||||||
{
|
{
|
||||||
int r = stringbuf_ensure_space(b, strlen(msg) + 1);
|
size_t slen = strlen(msg);
|
||||||
|
|
||||||
|
int r = stringbuf_ensure_space(b, slen + 1);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
size_t slen = strlen(msg);
|
|
||||||
|
|
||||||
if (!b->data) /* cannot happen, but let's make scan-build happy */
|
if (!b->data) /* cannot happen, but let's make scan-build happy */
|
||||||
abort();
|
abort();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue