aboutsummaryrefslogtreecommitdiff
path: root/engines/glk/agt/util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/glk/agt/util.cpp')
-rw-r--r--engines/glk/agt/util.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/engines/glk/agt/util.cpp b/engines/glk/agt/util.cpp
index c91e47a74f..47900fc74e 100644
--- a/engines/glk/agt/util.cpp
+++ b/engines/glk/agt/util.cpp
@@ -376,7 +376,8 @@ size_t fread(void *ptr, size_t size, size_t nmemb, genfile stream) {
size_t fwrite(const void *ptr, size_t size, size_t nmemb, genfile stream) {
Common::WriteStream *ws = dynamic_cast<Common::WriteStream *>(stream);
assert(ws);
- return ws->write(ptr, size * nmemb);
+ size_t bytesWritten = ws->write(ptr, size * nmemb);
+ return bytesWritten / size;
}
size_t ftell(genfile f) {