From: Hans Dedecker Date: Sat, 31 Mar 2018 16:57:45 +0000 (+0200) Subject: odhcp6c: improve code readibility X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=5cbd305a7a7166e5d4d0cb4050560207dfb66c5f;p=project%2Fodhcp6c.git odhcp6c: improve code readibility Improve code readibility by always checking the sep variable for end of option data in the different option data parsing functions. Signed-off-by: Hans Dedecker --- diff --git a/src/odhcp6c.c b/src/odhcp6c.c index b055b70..48e3dee 100644 --- a/src/odhcp6c.c +++ b/src/odhcp6c.c @@ -1000,7 +1000,7 @@ static int parse_opt_dns_string(const char *src, uint8_t **dst, const bool array i_len -= strlen(src) + (sep ? 1 : 0); src = sep; - if (src) + if (sep) sep = get_sep_pos(src, ARRAY_SEP); } while (i_len); @@ -1035,7 +1035,7 @@ static int parse_opt_ip6(const char *src, uint8_t **dst, const bool array) i_len -= strlen(src) + (sep ? 1 : 0); src = sep; - if (src) + if (sep) sep = get_sep_pos(src, ARRAY_SEP); } while (i_len); @@ -1074,7 +1074,7 @@ static int parse_opt_user_class(const char *src, uint8_t **dst, const bool array i_len -= str_len + (sep ? 1 : 0); src = sep; - if (src) + if (sep) sep = get_sep_pos(src, ARRAY_SEP); } while (i_len);