Fix returning on error from vararg function `cmp_find_many()` not calling `va_end()`

Fortune for naka's current commit: Future blessing − 末吉
master
Avril 3 years ago
parent 77c57d3624
commit 947b801153
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -25,14 +25,18 @@ int cmp_find_many(usize nhaystacks; const map_t *pIN needle, usize sizes[pOUT nh
va_start(v_haystacks, nhaystacks);
const map_t* pINOUT haystack;
register int rval=-1;
for(usize i=0;i<nhaystacks;i++)
{
usize *pOUT size = sizes + i;
haystack = va_arg(v_haystacks, const map_t* pIN);
if(!haystack || !haystack->origin) FATAL("haystack %lu was null or its origin was null", i);
if(!cmp_find(needle, haystack, size)) return (int)i;
if(!cmp_find(needle, haystack, size)) {
rval = (int)i;
break;
}
}
va_end(v_haystacks);
return -1;
return rval;
}

Loading…
Cancel
Save