diff --git a/src/rlgl.h b/src/rlgl.h index 0bbbf2fd1..f2c796dee 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -3013,8 +3013,10 @@ char *LoadText(const char *fileName) if (count < size) { text = RL_REALLOC(text, count + 1); - text[count] = '\0'; } + + // zero-terminate the string + text[count] = '\0'; } fclose(textFile);