diff --git a/dongle_infrastructure.c b/dongle_infrastructure.c index f346dc07a90bb4b1070da7bd488666b4f477ee6b..65c0cdf8f89863298f045a43dd409b71ed095432 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 b3a65123cc0532f2192c253c350ab1400fa34253..758baf49e3d68f99b243b40cb3a3d1bab04e99d5 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;