mirror of
https://github.com/xzeldon/htop.git
synced 2025-02-17 00:13:24 +03:00
Drop unneeded variablw initialization and reduce scope
This commit is contained in:
parent
1533ea88a6
commit
27870bd4de
@ -482,7 +482,6 @@ static bool LinuxProcessList_readSmapsFile(LinuxProcess* process, const char* di
|
|||||||
char buffer[CRT_pageSize];// 4k
|
char buffer[CRT_pageSize];// 4k
|
||||||
char *start,*end;
|
char *start,*end;
|
||||||
ssize_t nread=0;
|
ssize_t nread=0;
|
||||||
int tmp=0;
|
|
||||||
if(haveSmapsRollup) {// only available in Linux 4.14+
|
if(haveSmapsRollup) {// only available in Linux 4.14+
|
||||||
xSnprintf(buffer, sizeof(buffer), "%s/%s/smaps_rollup", dirname, name);
|
xSnprintf(buffer, sizeof(buffer), "%s/%s/smaps_rollup", dirname, name);
|
||||||
} else {
|
} else {
|
||||||
@ -500,6 +499,7 @@ static bool LinuxProcessList_readSmapsFile(LinuxProcess* process, const char* di
|
|||||||
start = (char *)&buffer;
|
start = (char *)&buffer;
|
||||||
end = start + nread;
|
end = start + nread;
|
||||||
do{//parse 4k block
|
do{//parse 4k block
|
||||||
|
int tmp;
|
||||||
|
|
||||||
if( (tmp = (end - start)) > 0 &&
|
if( (tmp = (end - start)) > 0 &&
|
||||||
(start = memmem(start,tmp,"\nPss:",5)) != NULL )
|
(start = memmem(start,tmp,"\nPss:",5)) != NULL )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user