diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c index 59b7e61246bb..7662474ff7aa 100644 --- a/sbin/newfs/newfs.c +++ b/sbin/newfs/newfs.c @@ -153,7 +153,8 @@ main(int argc, char *argv[]) case 'L': volumelabel = optarg; i = -1; - while (isalnum(volumelabel[++i])); + while (isalnum(volumelabel[++i]) || + volumelabel[i] == '_'); if (volumelabel[i] != '\0') { errx(1, "bad volume label. Valid characters are alphanumerics."); }