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/snapshot.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'apps/plugins/zxbox/snapshot.c') 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) { int type; - rb->strncpy(filenamebuf, name, MAXFILENAME-10); - filenamebuf[MAXFILENAME-10] = '\0'; + rb->strlcpy(filenamebuf, name, MAXFILENAME-10 + 1); type = SN_Z80; if(check_ext(filenamebuf, "z80")) type = SN_Z80; @@ -642,8 +641,7 @@ void load_snapshot_file_type(char *name, int type) int snsh; SNFILE snfil; - rb->strncpy(filenamebuf, name, MAXFILENAME-10); - filenamebuf[MAXFILENAME-10] = '\0'; + rb->strlcpy(filenamebuf, name, MAXFILENAME-10 + 1); spcf_find_file_type(filenamebuf, &filetype, &type); if(type < 0) type = SN_Z80; -- cgit v1.2.3