Hi,
This PR mainly addresses these "errors", listed below.
(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.
(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.
(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).
(Monitor.c) threshold was already checked whether its value is NULL or not. So the second check is pointless there.
Hi, This PR mainly addresses these "errors", listed below.
DotnetHelpers.c
)fgets(...)
checks two times, the same buffer. Since it's a while loop and if the content isNULL
it will be the same as checking it first in an if statement.GenHelpers.c
)GetUint16(...)
function implements the for loop in a way wherestrlen(...)
function will get called on each iteration. So instead, a variable containing the pre-calculated length would be better.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).Monitor.c
)threshold
was already checked whether its value isNULL
or not. So the second check is pointless there.