Merge branch 'fix-stb_include_strings' of https://github.com/sp0lsh/stb into work2
This commit is contained in:
commit
fad1aa50c9
@ -26,6 +26,13 @@
|
|||||||
// stdio.h FILE, fopen, fclose, fseek, ftell
|
// stdio.h FILE, fopen, fclose, fseek, ftell
|
||||||
// stdlib.h malloc, realloc, free
|
// stdlib.h malloc, realloc, free
|
||||||
// string.h strcpy, strncmp, memcpy
|
// string.h strcpy, strncmp, memcpy
|
||||||
|
//
|
||||||
|
// Credits:
|
||||||
|
//
|
||||||
|
// Written by Sean Barrett.
|
||||||
|
//
|
||||||
|
// Fixes:
|
||||||
|
// Michal Klos
|
||||||
|
|
||||||
#ifndef STB_INCLUDE_STB_INCLUDE_H
|
#ifndef STB_INCLUDE_STB_INCLUDE_H
|
||||||
#define 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;
|
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…
Reference in New Issue
Block a user