Commit 6148830d authored by vysheng's avatar vysheng

Merge pull request #643 from lyager/master

Use sizeof() to get size of sun_path.
parents e8c16c6c de5d6de0
......@@ -939,7 +939,7 @@ int main (int argc, char **argv) {
serv_addr.sun_family = AF_UNIX;
snprintf (serv_addr.sun_path, 108, "%s", unix_socket);
snprintf (serv_addr.sun_path, sizeof(serv_addr.sun_path), "%s", unix_socket);
if (bind (usfd, (struct sockaddr *) &serv_addr, sizeof (serv_addr)) < 0) {
perror ("bind");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment