stb_include: fix stb_include_string iteration. Upper bound was incremented each loop instead of iterator causing endless loop when called

This commit is contained in:
Michal Klos 2019-11-11 13:59:19 +01:00
parent f67165c2bb
commit cdf3ef1536

View File

@ -249,11 +249,11 @@ char *stb_include_strings(char **strs, int count, char *inject, char *path_to_in
char *result; char *result;
int i; int i;
size_t length=0; size_t length=0;
for (i=0; i < count; ++count) for (i=0; i < count; ++i)
length += strlen(strs[i]); length += strlen(strs[i]);
text = (char *) malloc(length+1); text = (char *) malloc(length+1);
length = 0; length = 0;
for (i=0; i < count; ++count) { for (i=0; i < count; ++i) {
strcpy(text + length, strs[i]); strcpy(text + length, strs[i]);
length += strlen(strs[i]); length += strlen(strs[i]);
} }