Removing a warning 54/29854/1
authorJosé Bollo <jose.bollo@open.eurogiciel.org>
Wed, 5 Nov 2014 09:04:28 +0000 (10:04 +0100)
committerJosé Bollo <jose.bollo@open.eurogiciel.org>
Wed, 5 Nov 2014 09:04:28 +0000 (10:04 +0100)
When compiled, the following warning was occuring:

 warning: format not a string literal and no format arguments

This commit solves the problem.

Change-Id: I271b6fcc3376bdaba8ed4bda3221d782c3e7381d
Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>
comm/comm_socket.c

index 3d5c22f..477845e 100755 (executable)
@@ -69,7 +69,7 @@ static int _get_new_socket(void)
 static void _set_sockaddr_un(struct sockaddr_un *saddr, const char *sock_path)
 {
        saddr->sun_family = AF_UNIX;
-       snprintf(saddr->sun_path, UNIX_PATH_MAX, sock_path);
+       strncpy(saddr->sun_path, sock_path, UNIX_PATH_MAX);
 }
 
 static const char *_create_server_sock_path(void)