From a4ab8c08eb4bd74dc22d98e0b1bb70372121fa36 Mon Sep 17 00:00:00 2001 From: blackpawn Date: Wed, 2 Dec 2015 23:12:12 -0600 Subject: [PATCH] Corrected fix for stb_insertn On insert the memmove length wasn't incorrect but the addlen call was. --- stb.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stb.h b/stb.h index 15ecf51..eb2b7f6 100644 --- a/stb.h +++ b/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); - stb__arr_addlen_(&p, size, i STB__ARGS); - memmove((char *) p + (i+n)*size, (char *) p + i*size, size * (z-(i+n))); + stb__arr_addlen_(&p, size, n STB__ARGS); + memmove((char *) p + (i+n)*size, (char *) p + i*size, size * (z-i)); } *pp = p; }