shithub: tinygl

Download patch

ref: 5e3f3c032dbd4baf5b0f500e6537406efe5e937c
parent: af3a7da7626fe4fe8932556c3786388bdd2bc241
author: gek169 <gek169>
date: Wed May 12 10:47:22 EDT 2021

Automatic commit.

--- a/include-demo/stringutil.h
+++ b/include-demo/stringutil.h
@@ -11,6 +11,10 @@
 #define STRUTIL_ALLOC(s) malloc(s)
 #endif
 
+#ifndef STRUTIL_CALLOC
+#define STRUTIL_CALLOC(n,s) calloc(n,s)
+#endif
+
 #ifndef STRUTIL_FREE
 #define STRUTIL_FREE(s) free(s)
 #endif
@@ -383,10 +387,10 @@
 	while(current_token_location > -1){
 		char* temp = strcatalloc(alloced_text+ current_token_location + len_token, "");
 		current->text = str_null_terminated_alloc(alloced_text,current_token_location);
-		free(alloced_text);
+		STRUTIL_FREE(alloced_text);
 		alloced_text = temp;
 		current_token_location = strfind(alloced_text, token);
-		current->right = calloc(1, sizeof(strll));
+		current->right = STRUTIL_CALLOC(1, sizeof(strll));
 		current = current->right;
 	}
 	return result;