From cdf3ef15366cb00b7fd0662cb7417b34c8fad25b Mon Sep 17 00:00:00 2001 From: Michal Klos Date: Mon, 11 Nov 2019 13:59:19 +0100 Subject: [PATCH] stb_include: fix stb_include_string iteration. Upper bound was incremented each loop instead of iterator causing endless loop when called --- stb_include.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stb_include.h b/stb_include.h index 7bdf7c4..5d18764 100644 --- a/stb_include.h +++ b/stb_include.h @@ -249,11 +249,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]); }