From 21fc7a4b7422f8b441a6266a11cc8e337aae190d Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Mon, 21 Jul 2014 22:51:54 +0200 Subject: Replace several uses of snprintf() by asprintf() Use asprintf() in some cold code paths. While allocating memory on the heap is a bit slower, using asprintf() is a bit more memory efficient and less prone to buffer overflow errors. Signed-off-by: Lukas Fleischer --- src/config.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/config.c') diff --git a/src/config.c b/src/config.c index 5eb526a..5ce7001 100644 --- a/src/config.c +++ b/src/config.c @@ -449,8 +449,7 @@ config_serialize_conf(char *buf, const char *key, for (i = 0; i < ARRAY_SIZE(confmap); i++) { if (!strcmp(confmap[i].key, key)) { - if (confmap[i]. - fn_serialize(buf, confmap[i].target)) { + if (confmap[i].fn_serialize(buf, confmap[i].target)) { if (status) status->done[i] = 1; return 1; -- cgit v1.2.3-54-g00ecf