aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-light/src/config/controlState.c
diff options
context:
space:
mode:
Diffstat (limited to 'hicn-light/src/config/controlState.c')
-rw-r--r--hicn-light/src/config/controlState.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/hicn-light/src/config/controlState.c b/hicn-light/src/config/controlState.c
index d8260e8e8..96c0529ed 100644
--- a/hicn-light/src/config/controlState.c
+++ b/hicn-light/src/config/controlState.c
@@ -19,7 +19,6 @@
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
-#include <strings.h>
#include <parc/assert/parc_Assert.h>
#include <string.h>
@@ -66,7 +65,7 @@ int controlState_connectToFwdDeamon() {
// Filling server information
servaddr.sin_family = AF_INET;
servaddr.sin_port = htons(PORT);
- servaddr.sin_addr.s_addr = INADDR_ANY;
+ inet_pton(AF_INET, SRV_IP, &(servaddr.sin_addr.s_addr));
// Establish connection
if (connect(sockfd, (struct sockaddr *)&servaddr, sizeof(servaddr)) < 0) {
@@ -150,10 +149,12 @@ static PARCList *_controlState_ParseStringIntoTokens(
parcMemory_StringDuplicate(originalString, strlen(originalString) + 1);
char *string = tofree;
- while ((token = strsep(&string, " \t\n")) != NULL) {
+ token = strtok(string, " \t\n");
+ while (token != NULL) {
if (strlen(token) > 0) {
parcList_Add(list, strdup(token));
}
+ token = strtok(NULL, " \t\n");
}
parcMemory_Deallocate((void **)&tofree);