sveinbjornt / Sloth

Mac app that shows all open files, directories, sockets, pipes and devices in use by all running processes. Nice GUI for lsof.
https://sveinbjorn.org/sloth
BSD 3-Clause "New" or "Revised" License
8.31k stars 158 forks source link

Fix process names #7

Closed 0xced closed 5 years ago

0xced commented 5 years ago

Fix empty process names

Mobile Mouse Server and CloudApp both return an empty string through the CopyProcessName method. Returning nil instead of empty string makes Sloth go to another way of finding the correct process name.

Fix call to proc_name

Although not documented, the proc_name method returns 0 on failure and the legth of the process name on success. In release configuration, it is not a problem but in debug configuration Sloth was going through +procNameForPID: and returned whatever was in the uninitialized name[1024] buffer when the proc_name call failed.

sveinbjornt commented 5 years ago

Thank you, much appreciated!