Replace NACT::fatal() with global sys_error()

This commit is contained in:
kichikuou
2024-12-10 07:54:56 +09:00
parent 5483d1932f
commit e79f24d8b9
10 changed files with 53 additions and 52 deletions
+5 -4
View File
@@ -1,5 +1,6 @@
#include "scenario.h"
#include <string.h>
#include "common.h"
#include "encoding.h"
void Scenario::skip_string(Encoding *enc, uint8_t terminator)
@@ -20,10 +21,10 @@ void Scenario::get_syseng_string(char* buf, int size, Encoding *enc, uint8_t ter
if (c != '\\')
ungetd();
int len = enc->mblen(ptr());
if (i + len < size - 1) {
memcpy(&buf[i], ptr(), len);
i += len;
}
if (i + len >= size)
sys_error("String buffer overrun at %d:0x%x", page(), start_addr);
memcpy(&buf[i], ptr(), len);
i += len;
skip(len);
}
buf[i] = '\0';