From 5d91a2680e594d47ed137b45f79738bddb641cea Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 18 Oct 2011 18:03:10 +0200 Subject: lib/util: untangle assignent from check in strhex_to_str() --- lib/util/util.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/util/util.c b/lib/util/util.c index b700f372c7..c5ed6fd0c7 100644 --- a/lib/util/util.c +++ b/lib/util/util.c @@ -712,13 +712,17 @@ _PUBLIC_ size_t strhex_to_str(char *p, size_t p_len, const char *strhex, size_t } for (; i < strhex_len && strhex[i] != 0; i++) { - if (!(p1 = strchr(hexchars, toupper((unsigned char)strhex[i])))) + p1 = strchr(hexchars, toupper((unsigned char)strhex[i])); + if (p1 == NULL) { break; + } i++; /* next hex digit */ - if (!(p2 = strchr(hexchars, toupper((unsigned char)strhex[i])))) + p2 = strchr(hexchars, toupper((unsigned char)strhex[i])); + if (p2 == NULL) { break; + } /* get the two nybbles */ hinybble = PTR_DIFF(p1, hexchars); -- cgit