mirror of https://github.com/xzeldon/htop.git
linux/LinuxProcessList: fix reading of number of read syscalls of process
The "if" tests if the character at index "5" is 'r', as a first quick check. However at index "5" will always be a colon ":". This patch fixes the off-by-one error. htop now shows proper values in the RD_SYSC column. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
parent
df9922a67e
commit
70ed51a303
|
@ -436,7 +436,7 @@ static void LinuxProcessList_readIoFile(LinuxProcess* process, const char* dirna
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
if (line[5] == 'r' && strncmp(line+1, "yscr: ", 6) == 0) {
|
if (line[4] == 'r' && strncmp(line+1, "yscr: ", 6) == 0) {
|
||||||
process->io_syscr = strtoull(line+7, NULL, 10);
|
process->io_syscr = strtoull(line+7, NULL, 10);
|
||||||
} else if (strncmp(line+1, "yscw: ", 6) == 0) {
|
} else if (strncmp(line+1, "yscw: ", 6) == 0) {
|
||||||
process->io_syscw = strtoull(line+7, NULL, 10);
|
process->io_syscw = strtoull(line+7, NULL, 10);
|
||||||
|
|
Loading…
Reference in New Issue