Corrected fix for stb_insertn

On insert the memmove length wasn't incorrect but the addlen call was.
pull/207/head
blackpawn 2015-12-02 23:12:12 -06:00
parent 28f1b0f569
commit a4ab8c08eb
1 changed files with 2 additions and 2 deletions

4
stb.h
View File

@ -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;
} }