mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-05-12 11:43:16 -04:00
Simpler const fix for fill_metadata_from_path()
Make sure the output of strchr(const*) is assinged to a const* This way the filename argument can stay const Change-Id: Ie46be936491eb62ba2a7e729b8cd7881e205bba7
This commit is contained in:
parent
026ce110f2
commit
8768266d27
2 changed files with 5 additions and 5 deletions
|
|
@ -381,7 +381,7 @@ bool format_buffers_with_offset(int afmt)
|
|||
/* Simple file type probing by looking at the filename extension. */
|
||||
unsigned int probe_file_format(const char *filename)
|
||||
{
|
||||
char *suffix;
|
||||
const char *suffix;
|
||||
unsigned int i;
|
||||
|
||||
suffix = strrchr(filename, '.');
|
||||
|
|
@ -554,8 +554,8 @@ void fill_metadata_from_path(struct mp3entry *id3, const char *trackname)
|
|||
wipe_mp3entry(id3);
|
||||
|
||||
/* Find the filename portion of the path */
|
||||
p = strrchr(trackname, '/');
|
||||
strlcpy(id3->id3v2buf, p ? ++p : id3->path, ID3V2_BUF_SIZE);
|
||||
const char *pt = strrchr(trackname, '/');
|
||||
strlcpy(id3->id3v2buf, pt ? ++pt : id3->path, ID3V2_BUF_SIZE);
|
||||
|
||||
/* Get the format from the extension and trim it off */
|
||||
p = strrchr(id3->id3v2buf, '.');
|
||||
|
|
|
|||
|
|
@ -317,7 +317,7 @@ void skin_error_format_message(void)
|
|||
char text[128];
|
||||
if (!error_line_start)
|
||||
return;
|
||||
char* line_end = strchr(error_line_start, '\n');
|
||||
const char* line_end = strchr(error_line_start, '\n');
|
||||
int len = MIN(line_end - error_line_start, 80);
|
||||
if (!line_end)
|
||||
len = strlen(error_line_start);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue