madwifi: make code a little bit clearer
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Fri, 4 Dec 2015 20:03:44 +0000 (21:03 +0100)
committerFlorian Forster <octo@collectd.org>
Sat, 5 Dec 2015 19:40:32 +0000 (20:40 +0100)
commit51f407eeaf373508098a06b9e352b7ed794d6335
tree44952bfc47d59eb24e0629a8368b24f5014364a5
parentdf6d9bfc1b24ecf4ebd1c86a57fc39f3b25abbb2
madwifi: make code a little bit clearer

buf2 is initialized to zero, readlink
will write at most sizeof(buf2) -1 bytes,
so the trailing null should not be overwritten.

Coverity doesn't see that, rewrite the code
differently so it does.

CID #38027

Signed-off-by: Florian Forster <octo@collectd.org>
src/madwifi.c