diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-12-07 11:17:32 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-01-01 14:50:25 -0800 |
commit | c46d912071dd8fad6c1ed532cbef26db34a639e9 (patch) | |
tree | 246413a71502c3a638d22099228d27242b4afadb /main.c | |
parent | 72a6cb64b0aded790e44d97e71434a4eddb91f15 (diff) |
Call strrchr() instead of hand coding a custom version
Also correct comments on hand-coded custom strcmp() replacements
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -728,9 +728,9 @@ base_name(const char *in_file) if (file == NULL) fatalerr("strdup() failure in %s()\n", __func__); - for (p = file + strlen(file); p > file && *p != '.'; p--); + p = strrchr(file, '.'); - if (*p == '.') + if (p != NULL) *p = '\0'; return (file); } |