git.samba.org
/
obnox
/
samba
/
samba-obnox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
196fd14
)
lib/util: untangle assignent from check in strhex_to_str()
author
Michael Adam
<obnox@samba.org>
Tue, 18 Oct 2011 16:03:10 +0000
(18:03 +0200)
committer
Michael Adam
<obnox@samba.org>
Tue, 18 Oct 2011 18:58:26 +0000
(20:58 +0200)
lib/util/util.c
patch
|
blob
|
history
diff --git
a/lib/util/util.c
b/lib/util/util.c
index b700f372c732a1c2bdde35697bc37c89aaad8388..c5ed6fd0c797bb35a411769625d569a92acd6a3e 100644
(file)
--- 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++) {
}
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;
break;
+ }
i++; /* next hex digit */
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;
break;
+ }
/* get the two nybbles */
hinybble = PTR_DIFF(p1, hexchars);
/* get the two nybbles */
hinybble = PTR_DIFF(p1, hexchars);