diff options
Diffstat (limited to 'apps/plugins/zxbox/snapshot.c')
-rw-r--r-- | apps/plugins/zxbox/snapshot.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/apps/plugins/zxbox/snapshot.c b/apps/plugins/zxbox/snapshot.c index d078ec78b1..9a68540a04 100644 --- a/apps/plugins/zxbox/snapshot.c +++ b/apps/plugins/zxbox/snapshot.c | |||
@@ -603,8 +603,7 @@ void save_snapshot_file(char *name) | |||
603 | { | 603 | { |
604 | int type; | 604 | int type; |
605 | 605 | ||
606 | rb->strncpy(filenamebuf, name, MAXFILENAME-10); | 606 | rb->strlcpy(filenamebuf, name, MAXFILENAME-10 + 1); |
607 | filenamebuf[MAXFILENAME-10] = '\0'; | ||
608 | 607 | ||
609 | type = SN_Z80; | 608 | type = SN_Z80; |
610 | if(check_ext(filenamebuf, "z80")) type = SN_Z80; | 609 | if(check_ext(filenamebuf, "z80")) type = SN_Z80; |
@@ -642,8 +641,7 @@ void load_snapshot_file_type(char *name, int type) | |||
642 | int snsh; | 641 | int snsh; |
643 | SNFILE snfil; | 642 | SNFILE snfil; |
644 | 643 | ||
645 | rb->strncpy(filenamebuf, name, MAXFILENAME-10); | 644 | rb->strlcpy(filenamebuf, name, MAXFILENAME-10 + 1); |
646 | filenamebuf[MAXFILENAME-10] = '\0'; | ||
647 | 645 | ||
648 | spcf_find_file_type(filenamebuf, &filetype, &type); | 646 | spcf_find_file_type(filenamebuf, &filetype, &type); |
649 | if(type < 0) type = SN_Z80; | 647 | if(type < 0) type = SN_Z80; |