diff --git a/tools/io.h b/tools/io.h index a6f6c47b..cd922275 100644 --- a/tools/io.h +++ b/tools/io.h @@ -50,7 +50,7 @@ bool ReadFile(const char* filename, const char* mode, std::vector* data) { return false; } } else { - if (ftell(fp) % sizeof(T)) { + if (sizeof(T) != 1 && (ftell(fp) % sizeof(T))) { fprintf(stderr, "error: corrupted word found in file '%s'\n", filename); return false; }