1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-02-26 16:53:30 +00:00

index/rindex are deprecated in favor of strchr/strrchr so use them directly (#71)

This commit is contained in:
Nick Briggs
2020-12-15 12:55:30 -08:00
committed by GitHub
parent 8e66ec841f
commit 525bda44c8
4 changed files with 4 additions and 12 deletions

View File

@@ -25,8 +25,6 @@ static char *id = "$Id: dir.c,v 1.4 2001/12/26 22:17:01 sybalsky Exp $ Copyright
#include <sys/param.h>
#else /* DOS, now */
#include <dos.h>
#define index strchr
#define rindex strrchr
#define MAXPATHLEN _MAX_PATH
#define MAXNAMLEN _MAX_PATH
#define alarm(x) 1
@@ -79,14 +77,14 @@ extern int Dummy_errno;
\
separate_version(tname, tver, 0); \
\
if ((pp = (char *)rindex(tname, '.')) == NULL) { \
if ((pp = (char *)strrchr(tname, '.')) == NULL) { \
*text = '\0'; \
} else { \
*pp = '\0'; \
strcpy(text, pp + 1); \
} \
\
if ((pp = (char *)rindex(pname, '.')) == NULL) { \
if ((pp = (char *)strrchr(pname, '.')) == NULL) { \
*pext = '\0'; \
} else { \
*pp = '\0'; \