Skip to content

Commit

Permalink
Merge pull request #5228 from thechampagne/main
Browse files Browse the repository at this point in the history
uucore: remove unnecessary heap allocation
  • Loading branch information
sylvestre authored Sep 1, 2023
2 parents 44f74c7 + 4f465eb commit 4413dd1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/uucore/src/lib/features/entries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) }
Expand Down

0 comments on commit 4413dd1

Please sign in to comment.