mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
Merge pull request #5228 from thechampagne/main
uucore: remove unnecessary heap allocation
This commit is contained in:
commit
4413dd13aa
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