Apply 1 suggestion(s) to 1 file(s)

Co-authored-by: Barnabás Pőcze <pobrn@protonmail.com>
This commit is contained in:
zhiwei zuo 2026-04-20 09:10:11 +00:00 committed by Wim Taymans
parent 0a38fedeec
commit c5e1a3eae3

View file

@ -918,10 +918,7 @@ static char **pw_strv_insert_at(char **strv, int len, int pos, const char *str)
while (strv != NULL && strv[len] != NULL) while (strv != NULL && strv[len] != NULL)
len++; len++;
} }
if (pos < 0 || pos > len)
if (pos < 0)
pos = 0;
else if (pos > len)
pos = len; pos = len;
n = realloc(strv, sizeof(char*) * (len + 2)); n = realloc(strv, sizeof(char*) * (len + 2));