From 7cad1f75c6d52ad1f1746aaeda9ff428ef82919b Mon Sep 17 00:00:00 2001 From: Jakob Olsson <jakobols@kth.se> Date: Fri, 1 Jun 2018 10:10:39 +0200 Subject: [PATCH] minor fixes --- dongle_infrastructure.c | 4 +++- dongle_infrastructure.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dongle_infrastructure.c b/dongle_infrastructure.c index f346dc0..65c0cdf 100644 --- a/dongle_infrastructure.c +++ b/dongle_infrastructure.c @@ -176,6 +176,7 @@ char *lexer(char **input, char *delimiter) perror("strdup"); goto fail_strdup; } + *input = token + strlen(delimiter); } else { substr = strdup(*input); @@ -183,6 +184,7 @@ char *lexer(char **input, char *delimiter) perror("strdup"); goto fail_strdup; } + *input[0] = '\0'; } @@ -365,7 +367,7 @@ fail: char *get_device_ip(char *device_name) { - char *iface, *destination, *gateway, *flags, *route, *binary, *ipv4_addr = NULL; + char *iface, *destination, *gateway, *flags, *route, *ipv4_addr = NULL; bool host_flag; struct in_addr addr; FILE *fp; diff --git a/dongle_infrastructure.h b/dongle_infrastructure.h index b3a6512..758baf4 100644 --- a/dongle_infrastructure.h +++ b/dongle_infrastructure.h @@ -4,6 +4,7 @@ #define IPV4_MAX 16 #define DYNAMIC_OBJ_NAME_SIZE 50 + struct USB { char *product; char *product_id; -- GitLab