]> code.delx.au - pulseaudio/commitdiff
module: Replace rindex() with strrchr()
authorTanu Kaskinen <tanu.kaskinen@linux.intel.com>
Mon, 27 Jan 2014 19:00:58 +0000 (21:00 +0200)
committerTanu Kaskinen <tanu.kaskinen@linux.intel.com>
Mon, 27 Jan 2014 19:00:58 +0000 (21:00 +0200)
rindex() appears to be "non-standard" to an extent, and it caused a
build failure on mingw32.

From the man page of rindex(): "POSIX.1-2008 removes the
specifications of index() and rindex(), recommending strchr(3) and
strrchr(3) instead."

src/pulsecore/module.c

index c57acac2a57e04d6b200793eac4d1cc12c1c69a7..bee8a20efbed43ecd7fb07541b691023f4b02194 100644 (file)
@@ -67,7 +67,7 @@ bool pa_module_exists(const char *name) {
 
     /* strip .so from the end of name, if present */
     n = pa_xstrdup(name);
-    p = rindex(n, '.');
+    p = strrchr(n, '.');
     if (p && pa_streq(p, PA_SOEXT))
         p[0] = 0;