diff --git a/src/timg.cc b/src/timg.cc index eb3fc0f..e2222f0 100644 --- a/src/timg.cc +++ b/src/timg.cc @@ -167,7 +167,7 @@ static int usage(const char *progname, ExitCode exit_code, int width, #else static constexpr char kFileType[] = "image"; #endif - const char *after_slash_progname = rindex(progname, '/'); + const char *after_slash_progname = strrchr(progname, '/'); progname = after_slash_progname ? after_slash_progname + 1 : progname; const char *const default_title = getenv("TIMG_DEFAULT_TITLE"); fprintf(stderr, "usage: %s [options] <%s> [<%s>...]\n", progname, kFileType,