aboutsummaryrefslogtreecommitdiff
path: root/games/fortune/fortune/fortune.c
diff options
context:
space:
mode:
Diffstat (limited to 'games/fortune/fortune/fortune.c')
-rw-r--r--games/fortune/fortune/fortune.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/games/fortune/fortune/fortune.c b/games/fortune/fortune/fortune.c
index e93b0e721da9..de85d09d584a 100644
--- a/games/fortune/fortune/fortune.c
+++ b/games/fortune/fortune/fortune.c
@@ -683,7 +683,7 @@ all_forts(FILEDESC *fp, char *offensive)
obscene->fd = fd;
obscene->inf = NULL;
obscene->path = offensive;
- if ((sp = rindex(offensive, '/')) == NULL)
+ if ((sp = strrchr(offensive, '/')) == NULL)
obscene->name = offensive;
else
obscene->name = ++sp;
@@ -785,7 +785,7 @@ is_fortfile(const char *file, char **datp, char **posp, int check_for_offend)
}
}
- if ((sp = rindex(file, '/')) == NULL)
+ if ((sp = strrchr(file, '/')) == NULL)
sp = file;
else
sp++;
@@ -797,7 +797,7 @@ is_fortfile(const char *file, char **datp, char **posp, int check_for_offend)
DPRINTF(2, (stderr, "FALSE (check fortunes only)\n"));
return (FALSE);
}
- if ((sp = rindex(sp, '.')) != NULL) {
+ if ((sp = strrchr(sp, '.')) != NULL) {
sp++;
for (i = 0; suflist[i] != NULL; i++)
if (strcmp(sp, suflist[i]) == 0) {