Corrected fix for stb_insertn
On insert the memmove length wasn't incorrect but the addlen call was.
This commit is contained in:
parent
28f1b0f569
commit
a4ab8c08eb
4
stb.h
4
stb.h
@ -3248,8 +3248,8 @@ void stb__arr_insertn_(void **pp, int size, int i, int n STB__PARAMS)
|
|||||||
}
|
}
|
||||||
|
|
||||||
z = stb_arr_len2(p);
|
z = stb_arr_len2(p);
|
||||||
stb__arr_addlen_(&p, size, i STB__ARGS);
|
stb__arr_addlen_(&p, size, n STB__ARGS);
|
||||||
memmove((char *) p + (i+n)*size, (char *) p + i*size, size * (z-(i+n)));
|
memmove((char *) p + (i+n)*size, (char *) p + i*size, size * (z-i));
|
||||||
}
|
}
|
||||||
*pp = p;
|
*pp = p;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user