Sysinternals / ProcDump-for-Linux

A Linux version of the ProcDump Sysinternals tool
MIT License
2.91k stars 302 forks source link

Applied few changes #211

Closed rilysh closed 10 months ago

rilysh commented 10 months ago

Hi, This PR mainly addresses these "errors", listed below.

  1. (DotnetHelpers.c) fgets(...) checks two times, the same buffer. Since it's a while loop and if the content is NULL it will be the same as checking it first in an if statement.
  2. (GenHelpers.c) GetUint16(...) function implements the for loop in a way where strlen(...) function will get called on each iteration. So instead, a variable containing the pre-calculated length would be better.
  3. (GenHelpers.c) GetPath(...) function uses a for loop, however, we're not using the index, so a while loop is better (will not require to have to compare on each iteration).
  4. (Monitor.c) threshold was already checked whether its value is NULL or not. So the second check is pointless there.
MarioHewardt commented 10 months ago

Thanks for the PR. Could you create new issues for each of the above and tag the PR with those issues?