forked from len0rd/rockbox
Replaced rindex() with strrchr().
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6596 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
61716dd645
commit
2258946855
1 changed files with 1 additions and 17 deletions
|
@ -350,28 +350,12 @@ bool codec_seek_buffer_callback(off_t newpos)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *rindex(const char *s, int c)
|
|
||||||
{
|
|
||||||
char *p = NULL;
|
|
||||||
|
|
||||||
if (s == NULL)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
while (*s != '\0') {
|
|
||||||
if (*s == c)
|
|
||||||
p = (char *)s;
|
|
||||||
s++;
|
|
||||||
}
|
|
||||||
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Simple file type probing by looking filename extension. */
|
/* Simple file type probing by looking filename extension. */
|
||||||
int probe_file_format(const char *filename)
|
int probe_file_format(const char *filename)
|
||||||
{
|
{
|
||||||
char *suffix;
|
char *suffix;
|
||||||
|
|
||||||
suffix = rindex(filename, '.');
|
suffix = strrchr(filename, '.');
|
||||||
if (suffix == NULL)
|
if (suffix == NULL)
|
||||||
return AFMT_UNKNOWN;
|
return AFMT_UNKNOWN;
|
||||||
suffix += 1;
|
suffix += 1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue