diff options
author | Nils Wallménius <nils@rockbox.org> | 2009-07-14 13:57:45 +0000 |
---|---|---|
committer | Nils Wallménius <nils@rockbox.org> | 2009-07-14 13:57:45 +0000 |
commit | 3d4701a6e41616cf581a297bab1451cf2db70249 (patch) | |
tree | f845837c96ffbed7d59ddf8308f3b3e7c40cb8c9 /apps/plugins/zxbox/tapefile.c | |
parent | c2900a1bacd5d98b57a0d15ea2add1bc08764057 (diff) | |
download | rockbox-3d4701a6e41616cf581a297bab1451cf2db70249.tar.gz rockbox-3d4701a6e41616cf581a297bab1451cf2db70249.zip |
FS#10080
* Move strncpy() from core to the pluginlib
* Introduce strlcpy() and use that instead in most places (use memcpy in a few) in core and some plugins
* Drop strncpy() from the codec api as no codec used it
* Bump codec and plugin api versions
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21863 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/zxbox/tapefile.c')
-rw-r--r-- | apps/plugins/zxbox/tapefile.c | 6 |
1 files changed, 2 insertions, 4 deletions
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: |