chiark / gitweb /
nss: remove dead code
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Thu, 18 Sep 2014 21:55:46 +0000 (23:55 +0200)
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Thu, 18 Sep 2014 22:15:39 +0000 (00:15 +0200)
commit66a16e7e9fc501d371b57cbe2ae5d130fe930c6d
treee6f0795d6a49f0abdf3f9ea880644f52d74a6510
parent2f905e821e0342c36f5a5d3a51d53aabccc800bd
nss: remove dead code

c > 0 is already guaranteed from earlier checks.

We go from

ms = ALIGN(l+1) +
        sizeof(char*) +
        (c > 0 ? c : 1) * ALIGN(alen) +
        (c > 0 ? c+1 : 2) * sizeof(char*);

to

ms = ALIGN(l+1) +
        sizeof(char*) +
        c * ALIGN(alen) +
        (c+1) * sizeof(char*);

to

ms = ALIGN(l+1) + c * ALIGN(alen) + (c+2) * sizeof(char*);

Found by coverity. Fixes: CID#1237570 and CID#1237610
src/nss-mymachines/nss-mymachines.c
src/nss-resolve/nss-resolve.c