diff options
author | Daniel Mack <daniel@zonque.org> | 2016-01-12 15:34:20 +0100 |
---|---|---|
committer | Daniel Mack <daniel@zonque.org> | 2016-01-12 15:36:32 +0100 |
commit | d054f0a4d451120c26494263fc4dc175bfd405b1 (patch) | |
tree | 43606871b8012973ac6f3936d4887a5c658ce097 /src/libsystemd-network/sd-dhcp-lease.c | |
parent | 1f52a79d4eb0216bf1f2d96539609f02d8bb9e71 (diff) |
tree-wide: use xsprintf() where applicable
Also add a coccinelle receipt to help with such transitions.
Diffstat (limited to 'src/libsystemd-network/sd-dhcp-lease.c')
-rw-r--r-- | src/libsystemd-network/sd-dhcp-lease.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libsystemd-network/sd-dhcp-lease.c b/src/libsystemd-network/sd-dhcp-lease.c index e875ba4986..6fb80dda7a 100644 --- a/src/libsystemd-network/sd-dhcp-lease.c +++ b/src/libsystemd-network/sd-dhcp-lease.c @@ -37,6 +37,7 @@ #include "in-addr-util.h" #include "network-internal.h" #include "parse-util.h" +#include "stdio-util.h" #include "string-util.h" #include "unaligned.h" @@ -839,7 +840,7 @@ int dhcp_lease_save(sd_dhcp_lease *lease, const char *lease_file) { LIST_FOREACH(options, option, lease->private_options) { char key[strlen("OPTION_000")+1]; - snprintf(key, sizeof(key), "OPTION_%"PRIu8, option->tag); + xsprintf(key, "OPTION_%" PRIu8, option->tag); r = serialize_dhcp_option(f, key, option->data, option->length); if (r < 0) goto fail; |