diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-06-23 15:38:30 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-06-23 15:38:30 -0700 |
commit | cad53ce8a705d2318a5c5c6b5567c36e3427bb4d (patch) | |
tree | a36371ff7846b1cf65dea982f93e897a97490c2f /tests/files.cpp | |
parent | bc56607957556d4cd83da9cb096ba144a9e206f7 (diff) |
fix bug with adding null terminator in readBinary
Diffstat (limited to 'tests/files.cpp')
-rw-r--r-- | tests/files.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/files.cpp b/tests/files.cpp index 202c03bb..39f9e61a 100644 --- a/tests/files.cpp +++ b/tests/files.cpp @@ -52,7 +52,8 @@ int main() FILE *other = fopen("test.file", "r"); assert(other); char otherData[1000]; - fread(otherData, 1, 10, other); + num = fread(otherData, 1, 9, other); + otherData[num] = 0; fclose(other); printf("other=%s.\n", otherData); |