summaryrefslogtreecommitdiffstats
path: root/extras/libmemif/src/socket.c
diff options
context:
space:
mode:
authorJakub Grajciar <jgrajcia@cisco.com>2018-04-12 13:56:29 +0200
committerDave Wallace <dwallacelf@gmail.com>2018-04-12 14:05:05 +0000
commit5e1f69a4eb920da36c2684d1c7433c424f94ad8f (patch)
tree8acfac9f33a67baca4810c4541b59976e85ef571 /extras/libmemif/src/socket.c
parent756cd9441752fc8f84104c9ee19099506ba89f85 (diff)
libmemif: fix clang compilation errors/warnings
Change-Id: I09444281a932d367162a10b90c3759db71c03350 Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Diffstat (limited to 'extras/libmemif/src/socket.c')
-rw-r--r--extras/libmemif/src/socket.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/extras/libmemif/src/socket.c b/extras/libmemif/src/socket.c
index e568079ab25..e8b14c9acdb 100644
--- a/extras/libmemif/src/socket.c
+++ b/extras/libmemif/src/socket.c
@@ -112,7 +112,7 @@ memif_msg_send_hello (int fd)
h->max_region = MEMIF_MAX_REGION;
h->max_log2_ring_size = MEMIF_MAX_LOG2_RING_SIZE;
- strncpy ((char *) h->name, lm->app_name, strlen (lm->app_name));
+ strncpy ((char *) h->name, (char *) lm->app_name, strlen ((char *) lm->app_name));
/* msg hello is not enqueued but sent directly,
because it is the first msg to be sent */
@@ -141,7 +141,7 @@ memif_msg_enq_init (memif_connection_t * c)
strncpy ((char *) i->name, (char *) lm->app_name,
strlen ((char *) lm->app_name));
- if (c->args.secret)
+ if (strlen((char *) c->args.secret) > 0)
strncpy ((char *) i->secret, (char *) c->args.secret, sizeof (i->secret));
e->next = NULL;
@@ -424,10 +424,10 @@ memif_msg_receive_init (memif_socket_t * ms, int fd, memif_msg_t * msg)
strncpy ((char *) c->remote_name, (char *) i->name,
strlen ((char *) i->name));
- if (c->args.secret)
+ if (strlen((char *) c->args.secret) > 0)
{
int r;
- if (i->secret)
+ if (strlen((char *) i->secret) > 0)
{
if (strlen ((char *) c->args.secret) != strlen ((char *) i->secret))
{