Use strrchr instead of rindex
This commit is contained in:
parent
f3cd34f1b9
commit
a0382e9245
1 changed files with 2 additions and 2 deletions
4
tftp.c
4
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);
|
||||
|
|
Loading…
Add table
Reference in a new issue