imgfile_sdl: Fix write seek and return result.

This commit is contained in:
joevt
2025-02-28 15:02:12 -08:00
committed by dingusdev
parent f3dec30c27
commit f21d2bd4ea
+2 -2
View File
@@ -94,10 +94,10 @@ uint64_t ImgFile::write(const void* buf, uint64_t offset, uint64_t length)
LOG_F(WARNING, "ImgFile::write before disk was opened, ignoring.");
return 0;
}
impl->stream->seekg(offset, std::ios::beg);
impl->stream->seekp(offset, std::ios::beg);
impl->stream->write((const char *)buf, length);
#if defined(WIN32) || defined(__APPLE__) || defined(__linux)
impl->stream->flush();
#endif
return impl->stream->gcount();
return uint64_t(impl->stream->tellp()) - offset;
}