Skip to content

Commit 2e01edd

Browse files
committed
pwdx: use usize when parsing pid, not i32
1 parent 005c7ea commit 2e01edd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/uu/pwdx/src/pwdx.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
2020
let sys = System::new_all();
2121

2222
for pid_str in pids {
23-
let pid = match pid_str.parse::<i32>() {
23+
let pid = match pid_str.parse::<usize>() {
2424
// PIDs start at 1, hence 0 is invalid
2525
Ok(0) | Err(_) => {
2626
return Err(USimpleError::new(
@@ -31,7 +31,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
3131
Ok(pid) => pid,
3232
};
3333

34-
match sys.process(Pid::from(pid as usize)) {
34+
match sys.process(Pid::from(pid)) {
3535
Some(process) => match process.cwd() {
3636
Some(cwd) => println!("{pid}: {}", cwd.display()),
3737
None => {

0 commit comments

Comments
 (0)