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/recorder/radio.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'apps/recorder/radio.c') diff --git a/apps/recorder/radio.c b/apps/recorder/radio.c index 68c45c4f01..c5729ba8b2 100644 --- a/apps/recorder/radio.c +++ b/apps/recorder/radio.c @@ -1138,7 +1138,7 @@ void radio_load_presets(char *filename) } /* Temporary preset, loaded until player shuts down. */ else if(filename[0] == '/') - strncpy(filepreset, filename, sizeof(filepreset)); + strlcpy(filepreset, filename, sizeof(filepreset)); /* Preset from default directory. */ else snprintf(filepreset, sizeof(filepreset), "%s/%s.fmr", @@ -1159,8 +1159,7 @@ void radio_load_presets(char *filename) { struct fmstation * const fms = &presets[num_presets]; fms->frequency = f; - strncpy(fms->name, name, MAX_FMPRESET_LEN); - fms->name[MAX_FMPRESET_LEN] = '\0'; + strlcpy(fms->name, name, MAX_FMPRESET_LEN+1); num_presets++; } } -- cgit v1.2.3