Fixed a hash collision causing null variables to be overwritten

Andrew, don't you dare run my code through a clanker again or I'll hunt
your Canuck ass down and beat you with a hockey stick.
This commit is contained in:
2026-05-26 17:52:07 +10:00
parent b0387edeb0
commit 69175e801a
9 changed files with 24 additions and 10 deletions
+3 -3
View File
@@ -26,7 +26,7 @@ unsigned char* readFile(char* path, int* size) {
//determine the file's length
fseek(file, 0L, SEEK_END);
*size = ftell(file);
*size = (int)ftell(file);
rewind(file);
//make some space
@@ -44,7 +44,7 @@ unsigned char* readFile(char* path, int* size) {
return NULL;
}
buffer[(*size)++] = '\0';
buffer[(*size)] = '\0';
//clean up and return
fclose(file);
@@ -334,7 +334,7 @@ int repl(const char* filepath, bool verbose) {
inputBuffer[--length] = '\0';
}
if (length == 0 || !inputBuffer[ strspn(inputBuffer, " \r\n\t") ]) {
if (length == 0 || inputBuffer[ strspn(inputBuffer, " \r\n\t") ] == '\0') {
printf("%s> ", prompt); //shows the terminal prompt and restart
continue;
}