diff options
Diffstat (limited to 'apps/plugins/zxbox')
-rw-r--r-- | apps/plugins/zxbox/snapshot.c | 6 | ||||
-rw-r--r-- | apps/plugins/zxbox/spconf.c | 3 | ||||
-rw-r--r-- | apps/plugins/zxbox/sptape.c | 3 | ||||
-rw-r--r-- | apps/plugins/zxbox/tapefile.c | 6 |
4 files changed, 6 insertions, 12 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; |
diff --git a/apps/plugins/zxbox/spconf.c b/apps/plugins/zxbox/spconf.c index 5a14959adc..728f78638c 100644 --- a/apps/plugins/zxbox/spconf.c +++ b/apps/plugins/zxbox/spconf.c | |||
@@ -111,8 +111,7 @@ void spcf_read_command_line(const void* parameter) | |||
111 | 111 | ||
112 | file_type = extensions[ix].type; | 112 | file_type = extensions[ix].type; |
113 | file_subtype = extensions[ix].subtype; | 113 | file_subtype = extensions[ix].subtype; |
114 | rb->strncpy(filenamebuf, parameter, MAXFILENAME - 10); | 114 | rb->strlcpy(filenamebuf, parameter, MAXFILENAME - 10 + 1); |
115 | filenamebuf[MAXFILENAME-10] = '\0'; | ||
116 | if(file_type < 0) file_subtype = -1; | 115 | if(file_type < 0) file_subtype = -1; |
117 | if(!spcf_find_file_type(filenamebuf, &file_type, &file_subtype)) | 116 | if(!spcf_find_file_type(filenamebuf, &file_type, &file_subtype)) |
118 | return; | 117 | return; |
diff --git a/apps/plugins/zxbox/sptape.c b/apps/plugins/zxbox/sptape.c index f0e04de2fb..21f962ea28 100644 --- a/apps/plugins/zxbox/sptape.c +++ b/apps/plugins/zxbox/sptape.c | |||
@@ -594,8 +594,7 @@ void start_play_file_type(char *name, int seg, int type) | |||
594 | { | 594 | { |
595 | int filetype = FT_TAPEFILE; | 595 | int filetype = FT_TAPEFILE; |
596 | 596 | ||
597 | rb->strncpy(tapename, name, MAXFILENAME-10); | 597 | rb->strlcpy(tapename, name, MAXFILENAME-10 + 1); |
598 | tapename[MAXFILENAME-10] = '\0'; | ||
599 | 598 | ||
600 | currseg = seg; | 599 | currseg = seg; |
601 | tapetype = type; | 600 | tapetype = type; |
diff --git a/apps/plugins/zxbox/tapefile.c b/apps/plugins/zxbox/tapefile.c index 19f6aba980..0e262aa0f7 100644 --- a/apps/plugins/zxbox/tapefile.c +++ b/apps/plugins/zxbox/tapefile.c | |||
@@ -510,8 +510,7 @@ static int interpret_tzx_header(byte *hb, struct seginfo *csp) | |||
510 | int blen; | 510 | int blen; |
511 | rb->snprintf(seg_desc,DESC_LEN, "Begin Group: "); | 511 | rb->snprintf(seg_desc,DESC_LEN, "Begin Group: "); |
512 | blen = (int) rb->strlen(seg_desc); | 512 | blen = (int) rb->strlen(seg_desc); |
513 | rb->strncpy(seg_desc+blen, (char *) rbuf, (unsigned) csp->len); | 513 | rb->strlcpy(seg_desc+blen, (char *) rbuf, (unsigned) csp->len + 1); |
514 | seg_desc[csp->len + blen] = '\0'; | ||
515 | } | 514 | } |
516 | break; | 515 | break; |
517 | 516 | ||
@@ -618,8 +617,7 @@ static int interpret_tzx_header(byte *hb, struct seginfo *csp) | |||
618 | return 0; | 617 | return 0; |
619 | } | 618 | } |
620 | csp->ptr += csp->len; | 619 | csp->ptr += csp->len; |
621 | rb->strncpy(seg_desc, (char *) rbuf, (unsigned) csp->len); | 620 | rb->strlcpy(seg_desc, (char *) rbuf, (unsigned) csp->len + 1); |
622 | seg_desc[csp->len] = '\0'; | ||
623 | break; | 621 | break; |
624 | 622 | ||
625 | case 0x32: | 623 | case 0x32: |