diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-09-11 12:45:32 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-09-17 08:33:11 -0700 |
commit | 776e7c4dae63e2541a6f3822c3e9d659f9af101e (patch) | |
tree | 1ee0135d7d138aad1837c21d1b985f2820338bde | |
parent | 0d1e202f83774543aeb6e66a9dc46160e2bfff5d (diff) |
Use standard strrchr() instead of ancient rindex()
As suggested by cppcheck:
xditview.c:359:32: style: Obsolescent function 'rindex' called.
It is recommended to use 'strrchr' instead. [rindexCalled]
if (name[0] != '/' && (n = rindex (name, '/')))
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | xditview.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -37,7 +37,7 @@ from the X Consortium. #include <X11/StringDefs.h> #include <X11/Xatom.h> #include <X11/Shell.h> -#include <X11/Xos.h> /* rindex declaration */ +#include <X11/Xos.h> #include <X11/Xaw/Paned.h> #include <X11/Xaw/Panner.h> #include <X11/Xaw/Porthole.h> @@ -356,7 +356,7 @@ VisitFile (char *name, Boolean resetPage) } XtSetValues (dvi, arg, i); XtSetArg (arg[0], XtNtitle, name); - if (name[0] != '/' && (n = rindex (name, '/'))) + if (name[0] != '/' && (n = strrchr (name, '/'))) n = n + 1; else n = name; |