Lose remaining traces of rindex.
authorTimo Korvola <tkorvola@iki.fi>
Fri, 2 Mar 2018 20:19:11 +0000 (22:19 +0200)
committerDavid Griffith <dave@661.org>
Sun, 11 Mar 2018 11:48:50 +0000 (04:48 -0700)
rindex never was but POSIX and is deprecated even there.  strrchr
does the same and is C89.

src/curses/ux_blorb.c
src/curses/ux_frotz.h

index 0db0f023d772827fd852b305587133fbc3f36d7b..db7ec07a104baa77627ba07150b1e36eb6213cc2 100644 (file)
@@ -89,7 +89,7 @@ bb_err_t ux_blorb_init(char *filename)
 
        mystring = malloc(len2 * sizeof(char) + 1);
         strncpy(mystring, filename, len1 * sizeof(char));
-       p = rindex(mystring, '.');
+       p = strrchr(mystring, '.');
        if (p != NULL)
            *p = '\0';
 
@@ -97,7 +97,7 @@ bb_err_t ux_blorb_init(char *filename)
 
        /* Check if foo.blb is there. */
         if ((fp = fopen(mystring, "rb")) == NULL) {
-           p = rindex(mystring, '.');
+           p = strrchr(mystring, '.');
            if (p != NULL)
                *p = '\0';
             strncat(mystring, EXT_BLORB3, len2 * sizeof(char));
index 61269813e29d26a355dbb9034bc4552321f85a3f..091e3629dc7894ed755758d5882988ace9b316fa 100644 (file)
 #include "../blorb/blorblow.h"
 #include "ux_setup.h"
 
-#ifndef rindex
-    #define rindex strrchr
-#endif
-
 #define MASTER_CONFIG          "frotz.conf"
 #define USER_CONFIG            ".frotzrc"
 #define ASCII_DEF              1