util: don't call function in macro argument v2

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1252>
This commit is contained in:
Kacper Piwiński 2025-06-29 07:32:25 +00:00
parent 8c15a01d16
commit 8ab0e53812

View file

@ -105,7 +105,8 @@ char **
strv_append_take(char **strv, char **str) strv_append_take(char **strv, char **str)
{ {
if (str && *str) { if (str && *str) {
size_t len = max(strv_len(strv) + 1, 2); size_t len = strv_len(strv) + 1;
len = max(len, 2);
char **s = realloc(strv, len * sizeof(*strv)); char **s = realloc(strv, len * sizeof(*strv));
if (!s) if (!s)