diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c index 000e03add4ca..8b32792c3c83 100644 --- a/sbin/newfs/newfs.c +++ b/sbin/newfs/newfs.c @@ -150,7 +150,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."); }