sopts is a string, so it should be a char[] rather than unsigned char[].
#define PROGNAME "decodeindex"
static const char *progname = PROGNAME;
#define PROGNAME "decodeindex"
static const char *progname = PROGNAME;
-static const unsigned char sopts[] = "VH";
+static const char sopts[] = "VH";
static const struct option lopts[] = {
{ "version", 0, NULL, 'V' },
{ "help", 0, NULL, 'H' },
static const struct option lopts[] = {
{ "version", 0, NULL, 'V' },
{ "help", 0, NULL, 'H' },