Don't apply basename() to character literals.
A character literal is const, and may be stored in read-only memory. basename() may modify the buffer it points to -- or it may return a pointer to static storage that is overwritten -- in either case casting to non-const and then possibly modifying it is a bad idea.
On FreeBSD, this crashes since 12.0's libc started modifying the buffer in-place, while clang puts the string literal in RO-memory.
Make a single non-literal static array for the filename, and modify it only once to get the basename.
Fixes #4 (closed)