mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-10 16:57:00 +08:00
use strlcpy() instead of snprintf() where it make sense
That should reduce wasted cycles.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user