Merge branch 'fix-stb_include_strings' of https://github.com/sp0lsh/stb into work2

This commit is contained in:
Sean Barrett 2020-02-02 09:46:48 -08:00
commit fad1aa50c9

View File

@ -26,6 +26,13 @@
// stdio.h FILE, fopen, fclose, fseek, ftell
// stdlib.h malloc, realloc, free
// string.h strcpy, strncmp, memcpy
//
// Credits:
//
// Written by Sean Barrett.
//
// Fixes:
// Michal Klos
#ifndef STB_INCLUDE_STB_INCLUDE_H
#define STB_INCLUDE_STB_INCLUDE_H
@ -249,11 +256,11 @@ char *stb_include_strings(char **strs, int count, char *inject, char *path_to_in
char *result;
int i;
size_t length=0;
for (i=0; i < count; ++count)
for (i=0; i < count; ++i)
length += strlen(strs[i]);
text = (char *) malloc(length+1);
length = 0;
for (i=0; i < count; ++count) {
for (i=0; i < count; ++i) {
strcpy(text + length, strs[i]);
length += strlen(strs[i]);
}