aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-light/src/hicn/cli/hicns.c
diff options
context:
space:
mode:
Diffstat (limited to 'hicn-light/src/hicn/cli/hicns.c')
-rw-r--r--hicn-light/src/hicn/cli/hicns.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hicn-light/src/hicn/cli/hicns.c b/hicn-light/src/hicn/cli/hicns.c
index fa668062d..c03fa8599 100644
--- a/hicn-light/src/hicn/cli/hicns.c
+++ b/hicn-light/src/hicn/cli/hicns.c
@@ -58,7 +58,7 @@ int shell(hc_sock_t *s) {
hc_command_t command = {0};
char *pos;
- if ((pos = strchr(line, '\n')) != NULL) {
+ if (line != NULL && (pos = strchr(line, '\n')) != NULL) {
*pos = '\0';
} else {
fprintf(stderr, "Error while reading command.\n");