mirror of
https://github.com/libretro/beetle-pce-fast-libretro.git
synced 2024-11-23 07:50:03 +00:00
Backport f725c34a50
This commit is contained in:
parent
14d5d40efc
commit
3db0ffaa04
@ -203,12 +203,15 @@ static int WriteStateChunk(StateMem *st, const char *sname, SFORMAT *sf)
|
||||
int32_t end_pos;
|
||||
|
||||
uint8_t sname_tmp[32];
|
||||
size_t sname_len = strlen(sname);
|
||||
|
||||
memset(sname_tmp, 0, sizeof(sname_tmp));
|
||||
memcpy((char *)sname_tmp, sname, 32);
|
||||
memcpy((char *)sname_tmp, sname, (sname_len < 32) ? sname_len : 32);
|
||||
|
||||
if(strlen(sname) > 32)
|
||||
#ifndef NDEBUG
|
||||
if(sname_len > 32)
|
||||
printf("Warning: section name is too long: %s\n", sname);
|
||||
#endif
|
||||
|
||||
smem_write(st, sname_tmp, 32);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user