Fix invalid strcmp length perfs parser

This commit is contained in:
JackCarterSmith 2024-09-17 16:13:29 +02:00
parent de3e842425
commit d3f28ab24c
Signed by: JackCarterSmith
GPG Key ID: 832E52F4E23F8F24

View File

@ -11,7 +11,7 @@
#ifndef __MINGW32__
static int parseLine(char* line) {
// This assumes that a digit will be found and the line ends in " Kb".
// This assumes that a digit will be found and the line ends in "kB".
int i = strlen(line);
const char* p = line;
while (*p <'0' || *p > '9') p++;
@ -43,7 +43,7 @@ static int getLinuxPhysicalMemUsage() {
char line[128];
while (fgets(line, 128, file) != NULL){
if (strncmp(line, "VmRSS:", 7) == 0){
if (strncmp(line, "VmRSS:", 6) == 0){
result = parseLine(line);
break;
}