diff --git a/JacksEscape.vcxproj b/JacksEscape.vcxproj
index 08f89e4..a269300 100644
--- a/JacksEscape.vcxproj
+++ b/JacksEscape.vcxproj
@@ -44,6 +44,8 @@
true
v143
Unicode
+ true
+ true
Application
diff --git a/leaderboards_file.c b/leaderboards_file.c
index 6faf3b6..d0d2300 100644
--- a/leaderboards_file.c
+++ b/leaderboards_file.c
@@ -19,7 +19,7 @@ void lboard_LoadFromFile(System_Leaderboards *sys, const char *filename) {
char linebuf[512];
memset(linebuf, 0, sizeof(linebuf));
while (!feof(f) && fgets(linebuf, sizeof(linebuf), f)) {
- while (linebuf[strlen(linebuf) - 1] == '\n')
+ while (linebuf[0] !='\0' && linebuf[strlen(linebuf) - 1] == '\n')
linebuf[strlen(linebuf) - 1] = '\0';
// Skip empty lines
diff --git a/render_bundle_file.c b/render_bundle_file.c
index ad4a74b..de1463b 100644
--- a/render_bundle_file.c
+++ b/render_bundle_file.c
@@ -119,8 +119,9 @@ void render_LoadBundle(const char *filename) {
}
char linebuf[512];
- while (!feof(f) && fgets(linebuf, sizeof(linebuf), f)) {
- while (linebuf[strlen(linebuf) - 1] == '\n')
+ memset(linebuf, 0, sizeof(linebuf));
+ while (!feof(f) && fgets(linebuf, sizeof(linebuf) - 1, f)) {
+ while (linebuf[0] !='\0' && linebuf[strlen(linebuf) - 1] == '\n')
linebuf[strlen(linebuf) - 1] = '\0';
char *cmd = strtok(linebuf, " ");