From cdf3ef15366cb00b7fd0662cb7417b34c8fad25b Mon Sep 17 00:00:00 2001 From: Michal Klos Date: Mon, 11 Nov 2019 13:59:19 +0100 Subject: [PATCH 1/2] 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]); } From 221a9efcfe8a7ae15b7e982c2a2b41172719f8d1 Mon Sep 17 00:00:00 2001 From: Michal Klos Date: Mon, 11 Nov 2019 14:21:41 +0100 Subject: [PATCH 2/2] added credits according to contributor guide --- stb_include.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/stb_include.h b/stb_include.h index 5d18764..2772936 100644 --- a/stb_include.h +++ b/stb_include.h @@ -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