Be explicit about truncation to silence warning.
authorFlorian Dold <florian.dold@gmail.com>
Thu, 28 Feb 2019 14:40:36 +0000 (15:40 +0100)
committerFlorian Dold <florian.dold@gmail.com>
Thu, 28 Feb 2019 14:46:13 +0000 (15:46 +0100)
commit66bc78945b25884c422139638117980aa256335f
tree62bbd96be7424c02ec33f0dc34c10431f1f0d867
parent6603f7e1a837d3a51a1949a6f4e1802b6ef3d806
Be explicit about truncation to silence warning.

Newer GCCs do not like truncation and emit a warning.  We don't want to
disable truncation warnings (-Wnostringop-truncation), as in some cases
these warnings can point to a security flaw.

Using strcat instead of strncat is fine, since *both* equally overflow
the destination buffer if not used carefully.

See https://developers.redhat.com/blog/2018/05/24/detecting-string-truncation-with-gcc-8/
src/util/network.c