--- sbin_nvmecontrol_comnd.c.orig 2019-02-22 11:14:11.002523000 -0500 +++ sbin_nvmecontrol_comnd.c 2019-02-22 11:39:05.891156000 -0500 @@ -131,16 +131,18 @@ } fprintf(stderr, "\n\n%s\n", f->descr); if (opts != NULL) { + int n; + fprintf(stderr, "Options:\n"); for (i = 0; opts[i].long_arg != NULL; i++) { + n = 0; *buf = '\0'; if (isprint(opts[i].short_arg)) { - snprintf(buf, sizeof(buf), " -%c, ", opts[i].short_arg); + n += snprintf(buf, sizeof(buf) - n, " -%c, ", opts[i].short_arg); } else { - strlcpy(buf, " ", sizeof(buf)); + n += snprintf(buf, sizeof(buf) - n, " "); } - strlcat(buf, "--", sizeof(buf)); - strlcat(buf, opts[i].long_arg, sizeof(buf)); + n += snprintf(buf,sizeof(buf) - n, "-- %s%c - %s\n", opts[i].long_arg, opts[i].at); arg_suffix(buf, sizeof(buf), opts[i].at); fprintf(stderr, "%-30.30s - %s\n", buf, opts[i].descr); }