diff options
author | João Valverde <j@v6e.pt> | 2022-09-27 15:24:48 +0100 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2022-09-27 19:01:18 +0100 |
commit | 79d02af2b595e438eae34ed7450f226084c93e37 (patch) | |
tree | 408c3fb3927fbf9d9e3fb2e539a0bbcaa4b82a02 /wsutil | |
parent | 9c4a42c07c2220a6a9832ef722e619eac1bc4291 (diff) |
wmem: Remove a redundant ternary operator
wmem_strbuf_grow should set the correct size with regard to max_size,
if set. In any case passing the actual free "raw" size to g_strlcpy is
always the correct thing to do.
Diffstat (limited to 'wsutil')
-rw-r--r-- | wsutil/wmem/wmem_strbuf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/wsutil/wmem/wmem_strbuf.c b/wsutil/wmem/wmem_strbuf.c index 47b515c5fe..00edf26264 100644 --- a/wsutil/wmem/wmem_strbuf.c +++ b/wsutil/wmem/wmem_strbuf.c @@ -139,7 +139,7 @@ wmem_strbuf_append(wmem_strbuf_t *strbuf, const gchar *str) wmem_strbuf_grow(strbuf, append_len); - (void) g_strlcpy(&strbuf->str[strbuf->len], str, strbuf->max_size ? WMEM_STRBUF_RAW_ROOM(strbuf) : append_len+1); + (void) g_strlcpy(&strbuf->str[strbuf->len], str, WMEM_STRBUF_RAW_ROOM(strbuf)); strbuf->len = MIN(strbuf->len + append_len, strbuf->alloc_size - 1); } |