dmsc / emu2

Simple x86 and DOS emulator for the Linux terminal.
GNU General Public License v2.0
406 stars 31 forks source link

dosnames: Replace rindex with strrchr #17

Closed bcoles closed 3 years ago

bcoles commented 3 years ago

rindex is deprecated:

CONFORMING TO
       4.3BSD; marked as LEGACY in POSIX.1-2001.  POSIX.1-2008 removes the specifications of index() and rindex(), recommending strchr(3) and strrchr(3) instead.

The rindex and strrchr functions are identical:

       char *strrchr(const char *s, int c);
       The strrchr() function returns a pointer to the last occurrence of the character c in the string s.
       char *rindex(const char *s, int c);
       The rindex() function returns a pointer to the last occurrence of the character c in the string s.
dmsc commented 3 years ago

Merged, thanks!