summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@intec.ugent.be>2016-02-26 16:11:17 +0100
committerSander Vrijders <sander.vrijders@intec.ugent.be>2016-02-26 16:11:17 +0100
commit49ffdfd539fc7de2c41127fd9b29ad8b90839238 (patch)
tree3130eabd52528fd626b5d692e716265928ebdea7 /src
parente36ae679a7a427b515fcc6a17a84f5e8a99544e3 (diff)
parentf02e1f68905a563e1d73a298e0de0e5da8b2eb9f (diff)
downloadouroboros-49ffdfd539fc7de2c41127fd9b29ad8b90839238.tar.gz
ouroboros-49ffdfd539fc7de2c41127fd9b29ad8b90839238.zip
Merged in sandervrijders/ouroboros/be-bugfixes (pull request #14)
Be bugfixes
Diffstat (limited to 'src')
-rw-r--r--src/lib/irm.c10
-rw-r--r--src/lib/sockets.c2
2 files changed, 8 insertions, 4 deletions
diff --git a/src/lib/irm.c b/src/lib/irm.c
index 2c9b530c..69a98039 100644
--- a/src/lib/irm.c
+++ b/src/lib/irm.c
@@ -46,13 +46,17 @@ int irm_create_ipcp(rina_name_t name,
msg.msgs.create_ipcp.ipcp_type = ipcp_type;
buf = serialize_irm_msg(&msg);
- if (buf == NULL)
+ if (buf == NULL) {
+ close(sockfd);
return -1;
+ }
- write(sockfd, buf->data, buf->size);
+ if (write(sockfd, buf->data, buf->size) == -1) {
+ close(sockfd);
+ return -1;
+ }
close(sockfd);
-
return 0;
}
diff --git a/src/lib/sockets.c b/src/lib/sockets.c
index 095c9e5c..0ebad842 100644
--- a/src/lib/sockets.c
+++ b/src/lib/sockets.c
@@ -45,7 +45,7 @@ int client_socket_open(char * file_name)
}
serv_addr.sun_family = AF_UNIX;
- sprintf(serv_addr.sun_path, file_name);
+ sprintf(serv_addr.sun_path, "%s", file_name);
if (connect(sockfd,
(struct sockaddr *) &serv_addr,