CHUNK_CARTHW_ = CHUNK_CARTHW, // 64 (defined in PicoInt)\r
} chunk_name_e;\r
\r
-static const char * const chunk_names[] = {\r
+static const char * const chunk_names[CHUNK_DEFAULT_COUNT] = {\r
"INVALID!",\r
"M68K state",\r
"RAM",\r
}\r
\r
#define CHECKED_WRITE(name,len,data) { \\r
- if (PicoStateProgressCB && name < CHUNK_DEFAULT_COUNT) { \\r
+ if (PicoStateProgressCB && name < CHUNK_DEFAULT_COUNT && chunk_names[name]) { \\r
strncpy(sbuff + 9, chunk_names[name], sizeof(sbuff) - 9); \\r
PicoStateProgressCB(sbuff); \\r
} \\r
}\r
\r
#define CHECKED_WRITE_BUFF(name,buff) { \\r
- if (PicoStateProgressCB && name < CHUNK_DEFAULT_COUNT) { \\r
+ if (PicoStateProgressCB && name < CHUNK_DEFAULT_COUNT && chunk_names[name]) { \\r
strncpy(sbuff + 9, chunk_names[name], sizeof(sbuff) - 9); \\r
PicoStateProgressCB(sbuff); \\r
} \\r