Fix sesutil locate when a sesid is passed to locate command

This commit is contained in:
Baptiste Daroussin 2015-12-11 21:11:02 +00:00
parent d7654478d3
commit 96e6c444c3

View File

@ -172,7 +172,7 @@ sesled(int argc, char **argv, bool setfault)
sesid = strtoul(disk, &endptr, 10);
if (*endptr == '\0') {
endptr = strrchr(uflag, '*');
if (*endptr == '*') {
if (endptr != NULL && *endptr == '*') {
warnx("Must specifying a SES device (-u) to use a SES "
"id# to identify a disk");
usage(stderr, (setfault ? "fault" : "locate"));