summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiika Pekkarinen <miipekk@ihme.org>2005-06-07 18:30:00 +0000
committerMiika Pekkarinen <miipekk@ihme.org>2005-06-07 18:30:00 +0000
commit2258946855c8839f159596dfc60a63b6ccfc0347 (patch)
tree1769113ac26c17c5968090d0b3b4e437eda7f44e
parent61716dd645f87d29f5bd10c22603ff3c5ad1babc (diff)
downloadrockbox-2258946855c8839f159596dfc60a63b6ccfc0347.tar.gz
rockbox-2258946855c8839f159596dfc60a63b6ccfc0347.zip
Replaced rindex() with strrchr().
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6596 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/playback.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/apps/playback.c b/apps/playback.c
index 73a014c9a9..d600fff667 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -350,28 +350,12 @@ bool codec_seek_buffer_callback(off_t newpos)
350 return true; 350 return true;
351} 351}
352 352
353char *rindex(const char *s, int c)
354{
355 char *p = NULL;
356
357 if (s == NULL)
358 return NULL;
359
360 while (*s != '\0') {
361 if (*s == c)
362 p = (char *)s;
363 s++;
364 }
365
366 return p;
367}
368
369/* Simple file type probing by looking filename extension. */ 353/* Simple file type probing by looking filename extension. */
370int probe_file_format(const char *filename) 354int probe_file_format(const char *filename)
371{ 355{
372 char *suffix; 356 char *suffix;
373 357
374 suffix = rindex(filename, '.'); 358 suffix = strrchr(filename, '.');
375 if (suffix == NULL) 359 if (suffix == NULL)
376 return AFMT_UNKNOWN; 360 return AFMT_UNKNOWN;
377 suffix += 1; 361 suffix += 1;