Fix generation of single random passwords.

This commit is contained in:
Kiyomichi Kosaka
2022-12-22 12:10:13 +00:00
parent e8345b374d
commit 03b2d43c6c
+1 -1
View File
@@ -434,7 +434,7 @@ impl<'a> LKEval<'a> {
genpwds.push((npwd, pass)); genpwds.push((npwd, pass));
} }
} else { } else {
let name = gen.trim_end_matches('X'); let name = pwd.name.trim_end_matches('X');
let num = rng.gen_range(1..10_u32.pow(gen.len().try_into().unwrap())); let num = rng.gen_range(1..10_u32.pow(gen.len().try_into().unwrap()));
let npwd = Password::from_password(&pwd); let npwd = Password::from_password(&pwd);
npwd.borrow_mut().name = Rc::new(format!("{}{}", name, num).to_string()); npwd.borrow_mut().name = Rc::new(format!("{}{}", name, num).to_string());