Replace rindex() with strrchr()
authorFredrik Fornwall <fredrik@fornwall.net>
Sun, 30 Aug 2015 08:54:06 +0000 (10:54 +0200)
committerFredrik Fornwall <fredrik@fornwall.net>
Sun, 30 Aug 2015 08:54:06 +0000 (10:54 +0200)
This fixes compilation on Android, and should be a general
improvement since rindex() is deprecated.

src/curses/ux_init.c

index 114aa8560dcc93b768207bf0321424574e0a0620..b1d3faca8c0bb6aba852c0809f7a781d87c2b7ad 100644 (file)
@@ -292,7 +292,7 @@ void os_process_arguments (int argc, char *argv[])
     f_setup.story_name = strdup(basename(argv[optind]));
 
     /* Now strip off the extension. */
-    p = rindex(f_setup.story_name, '.');
+    p = strrchr(f_setup.story_name, '.');
     if ((p != NULL) &&
         ((strcmp(p,EXT_BLORB2) == 0) ||
          (strcmp(p,EXT_BLORB3) == 0) ||