-rw-r--r-- | noncore/apps/opie-reader/plucker_base.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/noncore/apps/opie-reader/plucker_base.cpp b/noncore/apps/opie-reader/plucker_base.cpp index 81614f5..849edfc 100644 --- a/noncore/apps/opie-reader/plucker_base.cpp +++ b/noncore/apps/opie-reader/plucker_base.cpp | |||
@@ -43,9 +43,10 @@ void CPlucker_base::Expand(UInt32 reclen, UInt8 type, UInt8* buffer, UInt32 buff | |||
43 | { | 43 | { |
44 | unsuspend(); | 44 | unsuspend(); |
45 | if ((type%2 == 0) && (type != 14)) | 45 | if ((type%2 == 0) && (type != 14)) |
46 | { | 46 | { |
47 | fread(buffer, reclen, sizeof(char), fin); | 47 | size_t bytes_read = fread(buffer, reclen, sizeof(char), fin); |
48 | buffer[bytes_read] = '\0'; | ||
48 | } | 49 | } |
49 | else | 50 | else |
50 | { | 51 | { |
51 | UInt8* readbuffer = NULL; | 52 | UInt8* readbuffer = NULL; |
@@ -59,9 +60,10 @@ unsuspend(); | |||
59 | } | 60 | } |
60 | if (readbuffer != NULL) | 61 | if (readbuffer != NULL) |
61 | { | 62 | { |
62 | fread(readbuffer, reclen, sizeof(char), fin); | 63 | fread(readbuffer, reclen, sizeof(char), fin); |
63 | (*m_decompress)(readbuffer, reclen, buffer, buffersize); | 64 | size_t bytes_read = (*m_decompress)(readbuffer, reclen, buffer, buffersize); |
65 | buffer[bytes_read] = '\0'; | ||
64 | if (reclen > compressedbuffersize) | 66 | if (reclen > compressedbuffersize) |
65 | { | 67 | { |
66 | delete [] readbuffer; | 68 | delete [] readbuffer; |
67 | } | 69 | } |