use strlcpy() instead of snprintf() where it make sense

That should reduce wasted cycles.
This commit is contained in:
Nikos Mavrogiannopoulos
2014-12-14 19:24:11 +01:00
parent 853f7876cd
commit 07e01d06b5
16 changed files with 108 additions and 62 deletions

View File

@@ -488,7 +488,7 @@ void sec_mod_server(void *main_pool, struct cfg_st *config, const char *socket_f
memset(&sa, 0, sizeof(sa));
sa.sun_family = AF_UNIX;
snprintf(sa.sun_path, sizeof(sa.sun_path), "%s", socket_file);
strlcpy(sa.sun_path, socket_file, sizeof(sa.sun_path));
remove(socket_file);
#define SOCKET_FILE sa.sun_path