summaryrefslogtreecommitdiffhomepage
path: root/src/rlgl.h
diff options
context:
space:
mode:
authorbrankoku <[email protected]>2020-02-28 02:23:05 -0500
committerGitHub <[email protected]>2020-02-28 08:23:05 +0100
commit572969d8b7889856bf59a470c5ffe56a2d14761f (patch)
tree3d47ac646742612769d6fc503edaf19102ac2c29 /src/rlgl.h
parentf2247c6f0a2c200937f40c09d829e48360d42df7 (diff)
downloadraylib-572969d8b7889856bf59a470c5ffe56a2d14761f.tar.gz
raylib-572969d8b7889856bf59a470c5ffe56a2d14761f.zip
`LoadText()` tweak (#1113)
Guarantee string is zero-terminated
Diffstat (limited to 'src/rlgl.h')
-rw-r--r--src/rlgl.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rlgl.h b/src/rlgl.h
index 0bbbf2fd..f2c796de 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);