*/
#include "qemu/osdep.h"
-#include "qemu-common.h"
#include "sysemu/replay.h"
#include "replay-internal.h"
#include "qemu/error-report.h"
}
}
+static void replay_read_error(void)
+{
+ error_report("error reading the replay data");
+ exit(1);
+}
+
void replay_put_byte(uint8_t byte)
{
if (replay_file) {
{
uint8_t byte = 0;
if (replay_file) {
- byte = getc(replay_file);
+ int r = getc(replay_file);
+ if (r == EOF) {
+ replay_read_error();
+ }
+ byte = r;
}
return byte;
}
if (replay_file) {
*size = replay_get_dword();
if (fread(buf, 1, *size, replay_file) != *size) {
- error_report("replay read error");
+ replay_read_error();
}
}
}
*size = replay_get_dword();
*buf = g_malloc(*size);
if (fread(*buf, 1, *size, replay_file) != *size) {
- error_report("replay read error");
+ replay_read_error();
}
}
}