mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 19:47:45 +00:00
remove unnecessary heap allocation
This commit is contained in:
parent
44f74c7b25
commit
4f465eb76c
1 changed files with 1 additions and 1 deletions
|
@ -218,7 +218,7 @@ impl Passwd {
|
|||
let mut ngroups: c_int = 8;
|
||||
let mut ngroups_old: c_int;
|
||||
let mut groups = vec![0; ngroups.try_into().unwrap()];
|
||||
let name = CString::new(self.name.clone()).unwrap();
|
||||
let name = CString::new(self.name.as_bytes()).unwrap();
|
||||
loop {
|
||||
ngroups_old = ngroups;
|
||||
if unsafe { getgrouplist(name.as_ptr(), self.gid, groups.as_mut_ptr(), &mut ngroups) }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue