From 5cbd305a7a7166e5d4d0cb4050560207dfb66c5f Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Sat, 31 Mar 2018 18:57:45 +0200 Subject: [PATCH] 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 --- src/odhcp6c.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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); -- 2.30.2