* 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
This commit is contained in:
Nils Wallménius 2009-07-14 13:57:45 +00:00
parent c2900a1bac
commit 3d4701a6e4
83 changed files with 271 additions and 271 deletions

View file

@ -84,7 +84,7 @@ bool look_for_cuesheet_file(const char *trackpath, char *found_cue_path)
return false;
}
strncpy(cuepath, trackpath, MAX_PATH);
strlcpy(cuepath, trackpath, MAX_PATH);
dot = strrchr(cuepath, '.');
strcpy(dot, ".cue");
@ -103,7 +103,7 @@ bool look_for_cuesheet_file(const char *trackpath, char *found_cue_path)
}
if (found_cue_path)
strncpy(found_cue_path, cuepath, MAX_PATH);
strlcpy(found_cue_path, cuepath, MAX_PATH);
return true;
}
@ -205,8 +205,7 @@ bool parse_cuesheet(char *file, struct cuesheet *cue)
}
else
{
strncpy(dest, string, MAX_NAME*3);
dest[MAX_NAME*3] = '\0';
strlcpy(dest, string, MAX_NAME*3 + 1);
}
}
}
@ -218,10 +217,10 @@ bool parse_cuesheet(char *file, struct cuesheet *cue)
for (i = 0; i < cue->track_count; i++)
{
if (*(cue->tracks[i].performer) == '\0')
strncpy(cue->tracks[i].performer, cue->performer, MAX_NAME*3);
strlcpy(cue->tracks[i].performer, cue->performer, MAX_NAME*3);
if (*(cue->tracks[i].songwriter) == '\0')
strncpy(cue->tracks[i].songwriter, cue->songwriter, MAX_NAME*3);
strlcpy(cue->tracks[i].songwriter, cue->songwriter, MAX_NAME*3);
}
return true;
@ -271,7 +270,7 @@ static char *list_get_name_cb(int selected_item,
struct cuesheet *cue = (struct cuesheet *)data;
if (selected_item & 1)
strncpy(buffer, cue->tracks[selected_item/2].title, buffer_len);
strlcpy(buffer, cue->tracks[selected_item/2].title, buffer_len);
else
snprintf(buffer, buffer_len, "%02d. %s", selected_item/2+1,
cue->tracks[selected_item/2].performer);