File tree 2 files changed +12
-8
lines changed
WindowsDesktop/Siv3D/BinaryReader
macOS_Linux/Siv3D/BinaryReader
2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -246,14 +246,15 @@ namespace s3d
246
246
{
247
247
if (not m_file.file .read (static_cast <char *>(dst.pointer ), readBytes))
248
248
{
249
- m_file.pos = m_file.file .tellg ();
250
-
251
249
if (m_file.file .eof ())
252
250
{
251
+ setPos (previousPos);
253
252
return readBytes;
254
253
}
255
254
256
255
LOG_FAIL (U" ❌ BinaryReader `{0}`: ReadFile() failed" _fmt (m_info.fullPath ));
256
+
257
+ setPos (previousPos);
257
258
return 0 ;
258
259
}
259
260
}
@@ -286,14 +287,15 @@ namespace s3d
286
287
{
287
288
if (not m_file.file .read (static_cast <char *>(dst.pointer ), readBytes))
288
289
{
289
- m_file.pos = m_file.file .tellg ();
290
-
291
290
if (m_file.file .eof ())
292
291
{
292
+ setPos (previousPos);
293
293
return readBytes;
294
294
}
295
295
296
296
LOG_FAIL (U" ❌ BinaryReader `{0}`: ReadFile() failed" _fmt (m_info.fullPath ));
297
+
298
+ setPos (previousPos);
297
299
return 0 ;
298
300
}
299
301
}
Original file line number Diff line number Diff line change @@ -161,14 +161,15 @@ namespace s3d
161
161
{
162
162
if (not m_file.file .read (static_cast <char *>(dst.pointer ), readBytes))
163
163
{
164
- m_file.pos = m_file.file .tellg ();
165
-
166
164
if (m_file.file .eof ())
167
165
{
166
+ setPos (previousPos);
168
167
return readBytes;
169
168
}
170
169
171
170
LOG_FAIL (U" ❌ BinaryReader `{0}`: ReadFile() failed" _fmt (m_info.fullPath ));
171
+
172
+ setPos (previousPos);
172
173
return 0 ;
173
174
}
174
175
}
@@ -192,14 +193,15 @@ namespace s3d
192
193
{
193
194
if (not m_file.file .read (static_cast <char *>(dst.pointer ), readBytes))
194
195
{
195
- m_file.pos = m_file.file .tellg ();
196
-
197
196
if (m_file.file .eof ())
198
197
{
198
+ setPos (previousPos);
199
199
return readBytes;
200
200
}
201
201
202
202
LOG_FAIL (U" ❌ BinaryReader `{0}`: ReadFile() failed" _fmt (m_info.fullPath ));
203
+
204
+ setPos (previousPos);
203
205
return 0 ;
204
206
}
205
207
}
You can’t perform that action at this time.
0 commit comments