Skip to content

Commit

Permalink
Use more portable strrchr() instead of rindex().
Browse files Browse the repository at this point in the history
Issues #134
  • Loading branch information
hzeller committed Apr 23, 2024
1 parent d617cf6 commit 95694d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/timg.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 95694d5

Please sign in to comment.