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

master
Michal Klos ago%!(EXTRA string=6 years)
parent f67165c2bb
commit cdf3ef1536
  1. 4
      stb_include.h

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

Loading…
Cancel
Save