fix: add strings terminators
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user