mirror of https://github.com/xzeldon/htop.git
Drop always true condition
`env` is allocated by checked allocation functions and can not be NULL. This checks confuses clang analyzer and causes a null-dereference warning on `env[size-1]`.
This commit is contained in:
parent
cd55cfd6d2
commit
d5eb72e64d
|
@ -237,7 +237,7 @@ char* Platform_getProcessEnv(pid_t pid) {
|
||||||
if (fd) {
|
if (fd) {
|
||||||
size_t capacity = 4096, size = 0, bytes;
|
size_t capacity = 4096, size = 0, bytes;
|
||||||
env = xMalloc(capacity);
|
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;
|
size += bytes;
|
||||||
capacity *= 2;
|
capacity *= 2;
|
||||||
env = xRealloc(env, capacity);
|
env = xRealloc(env, capacity);
|
||||||
|
|
Loading…
Reference in New Issue