Use strrchr instead of rindex
authorJoseph C. Lehner <joseph.c.lehner@gmail.com>
Fri, 5 Feb 2016 11:56:15 +0000 (13:56 +0200)
committerJoseph C. Lehner <joseph.c.lehner@gmail.com>
Fri, 5 Feb 2016 12:22:57 +0000 (14:22 +0200)
tftp.c

diff --git a/tftp.c b/tftp.c
index 4e6b094eff0ba84318238985f6d6b296473a5932..a87f426c66b4a844f28fd9aadcbee26c85ec838d 100644 (file)
--- a/tftp.c
+++ b/tftp.c
@@ -44,8 +44,8 @@ static const char *x_basename(const char *path)
 {
        const char *slash, *bslash;
 
-       slash = rindex(path, '/');
-       bslash = rindex(path, '\\');
+       slash = strrchr(path, '/');
+       bslash = strrchr(path, '\\');
 
        if (slash && bslash) {
                path = 1 + (slash > bslash ? slash : bslash);