From 4e8e556a9329b1cb14bee2b146d40340582664d3 Mon Sep 17 00:00:00 2001 From: Maxim Biro Date: Wed, 8 Dec 2021 05:35:06 -0500 Subject: [PATCH] Fix previous refactor Includes should be sorted alphabetically and null-terminating is unnecessary with snprintf. --- other/bootstrap_daemon/src/config.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/other/bootstrap_daemon/src/config.c b/other/bootstrap_daemon/src/config.c index 30dfb525..b25e442e 100644 --- a/other/bootstrap_daemon/src/config.c +++ b/other/bootstrap_daemon/src/config.c @@ -12,9 +12,9 @@ #include "config_defaults.h" #include "log.h" +#include #include #include -#include #include @@ -242,7 +242,6 @@ int get_general_config(const char *cfg_file_path, char **pid_file_path, char **k size_t motd_length = tmp_motd_length > MAX_MOTD_LENGTH ? MAX_MOTD_LENGTH : tmp_motd_length; *motd = (char *)malloc(motd_length); snprintf(*motd, motd_length, "%s", tmp_motd); - (*motd)[motd_length - 1] = '\0'; } config_destroy(&cfg);