diff options
Diffstat (limited to 'lib/sender.c')
-rw-r--r-- | lib/sender.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/sender.c b/lib/sender.c index 7b5b0c9..7d2cd04 100644 --- a/lib/sender.c +++ b/lib/sender.c @@ -118,7 +118,7 @@ icipc_sender_new (const char *path, size_t user_size) { struct icipc_sender *self; - int name_size; + int res; if (path == NULL) return NULL; @@ -131,9 +131,8 @@ icipc_sender_new (const char *path, /* set address */ self->addr.sun_family = AF_LOCAL; - name_size = snprintf(self->addr.sun_path, sizeof(self->addr.sun_path), "%s", - path) + 1; - if (name_size > (int) sizeof(self->addr.sun_path)) + res = icipc_construct_socket_path (path, self->addr.sun_path, sizeof(self->addr.sun_path)); + if (res < 0) goto error; /* create socket */ |