fix: add strings terminators

This commit is contained in:
samsonium
2026-11-06 12:02:37 +03:00
parent d95ff88b66
commit 376e7bd1b4
12 changed files with 198 additions and 37 deletions
+3 -3
View File
@@ -10,7 +10,7 @@ bool vm_rd_char(FILE *fd, size_t count, char *o)
if (!fd || !o)
return false;
return fread(o, sizeof(char), count, fd) == (sizeof(char) * count);
return fread(o, sizeof(char), count, fd) == count;
}
// Read 16-byte uints with red bytes check
@@ -19,7 +19,7 @@ bool vm_rd_u16(FILE *fd, size_t count, uint16_t *o)
if (!fd || !o)
return false;
return fread(o, sizeof(uint16_t), count, fd) == (sizeof(uint16_t) * count);
return fread(o, sizeof(uint16_t), count, fd) == count;
}
// Read machine word-size uints with red bytes check
@@ -28,5 +28,5 @@ bool vm_rd_word(FILE *fd, size_t count, size_t *o)
if (!fd || !o)
return false;
return fread(o, sizeof(size_t), count, fd) == (sizeof(size_t) * count);
return fread(o, sizeof(size_t), count, fd) == count;
}