summaryrefslogtreecommitdiffstats
path: root/src/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/client.c')
-rw-r--r--src/client.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/client.c b/src/client.c
index 36e2565..67c6a2e 100644
--- a/src/client.c
+++ b/src/client.c
@@ -420,6 +420,10 @@ static int og_resp_refresh(json_t *data, struct og_client *cli)
if (link)
cli->speed = link;
+ /*
+ * status is the only received field when the response is coming from a
+ * client using linux/windows mode.
+ */
if (status) {
if (!strncmp(status, "LINUX", strlen("LINUX"))) {
cli->status = OG_CLIENT_STATUS_LINUX;
@@ -429,7 +433,7 @@ static int og_resp_refresh(json_t *data, struct og_client *cli)
return 0;
}
- if (strlen(serial_number) > 0)
+ if (serial_number && strlen(serial_number) > 0)
snprintf(cfg, sizeof(cfg), "ser=%s\n", serial_number);
for (i = 0; i < OG_DISK_MAX; i++) {