]> git.ipfire.org Git - thirdparty/systemd.git/commit
tree-wide: use STRLEN() to allocate buffer of constant size 7625/head
authorThomas Haller <thaller@redhat.com>
Wed, 13 Dec 2017 07:41:11 +0000 (08:41 +0100)
committerThomas Haller <thaller@redhat.com>
Wed, 13 Dec 2017 10:12:19 +0000 (11:12 +0100)
commitdbcb4a900ef7e9673604caabc1e1842309b7fd73
tree60ef21f2f084efa72e0284b0efdc433193158f96
parent6febe75da76517a69f073fb50abffc5c2c7d58cd
tree-wide: use STRLEN() to allocate buffer of constant size

Using strlen() to declare a buffer results in a variable-length array,
even if the compiler likely optimizes it to be a compile time constant.

When building with -Wvla, certain versions of gcc complain about such
buffers. Compiling with -Wvla has the advantage of preventing variably
length array, which defeat static asserts that are implemented by
declaring an array of negative length.
src/basic/fd-util.c
src/libsystemd-network/sd-dhcp-lease.c