diff --git a/sbin/reboot/reboot.c b/sbin/reboot/reboot.c --- a/sbin/reboot/reboot.c +++ b/sbin/reboot/reboot.c @@ -134,9 +134,9 @@ if (zfs) { char *slash; - if ((slash = strchr(sfs.f_mntfromname, '/')) == NULL) - E("Can't find ZFS pool name in %s", sfs.f_mntfromname); - *slash = '\0'; + slash = strchr(sfs.f_mntfromname, '/'); + if (slash != NULL) + *slash = '\0'; zfsbootcfg(sfs.f_mntfromname, force); }