From 3d4701a6e41616cf581a297bab1451cf2db70249 Mon Sep 17 00:00:00 2001 From: Nils Wallménius Date: Tue, 14 Jul 2009 13:57:45 +0000 Subject: 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 --- apps/plugins/zxbox/tapefile.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'apps/plugins/zxbox/tapefile.c') 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) int blen; rb->snprintf(seg_desc,DESC_LEN, "Begin Group: "); blen = (int) rb->strlen(seg_desc); - rb->strncpy(seg_desc+blen, (char *) rbuf, (unsigned) csp->len); - seg_desc[csp->len + blen] = '\0'; + rb->strlcpy(seg_desc+blen, (char *) rbuf, (unsigned) csp->len + 1); } break; @@ -618,8 +617,7 @@ static int interpret_tzx_header(byte *hb, struct seginfo *csp) return 0; } csp->ptr += csp->len; - rb->strncpy(seg_desc, (char *) rbuf, (unsigned) csp->len); - seg_desc[csp->len] = '\0'; + rb->strlcpy(seg_desc, (char *) rbuf, (unsigned) csp->len + 1); break; case 0x32: -- cgit v1.2.3