mirror of https://github.com/xzeldon/htop.git
commit
f6662f97fd
|
@ -237,7 +237,7 @@ char* Platform_getProcessEnv(pid_t pid) {
|
|||
if (fd) {
|
||||
size_t capacity = 4096, size = 0, bytes;
|
||||
env = xMalloc(capacity);
|
||||
while (env && (bytes = fread(env+size, 1, capacity-size, fd)) > 0) {
|
||||
while ((bytes = fread(env+size, 1, capacity-size, fd)) > 0) {
|
||||
size += bytes;
|
||||
capacity *= 2;
|
||||
env = xRealloc(env, capacity);
|
||||
|
|
Loading…
Reference in New Issue