Obsolete
/
libipc-old
Archived
3
0
Fork 0

fs.c: replaces rindex with strrchr

more_to_read
Philippe PITTOLI 2020-01-04 10:28:03 +01:00
parent f4ef46aa6c
commit 71eb8b3f61
1 changed files with 2 additions and 2 deletions

View File

@ -1,4 +1,4 @@
#include <strings.h>
#include <string.h>
#include <assert.h>
// error_message_format
@ -46,7 +46,7 @@ int dirname_ (const char *path, char *dname)
{
assert (dname != NULL);
char *last_slash = rindex (path, '/');
char *last_slash = strrchr (path, '/');
int pathlen = last_slash - path;
snprintf (dname, pathlen + 1, "%s", path);