diff options
author | Toomas Soome <tsoome@me.com> | 2018-09-24 10:51:18 -0700 |
---|---|---|
committer | Joshua M. Clulow <josh@sysmgr.org> | 2018-09-24 10:51:18 -0700 |
commit | 91b658d374482612d0b9b29aed694a252c07286f (patch) | |
tree | a1143e8067cf4bcdcd05f3c72808f9a3d789d205 /usr/src/lib/libsldap/common/ns_crypt.c | |
parent | 48d370f1e98a10b1bdf160dd83a49e0f49f6c1b7 (diff) | |
download | illumos-joyent-91b658d374482612d0b9b29aed694a252c07286f.tar.gz |
9169 libsldap: comparison between pointer and zero character constant
Reviewed by: Yuri Pankov <yuripv@yuripv.net>
Reviewed by: Andy Fiddaman <omnios@citrus-it.co.uk>
Reviewed by: Ken Mays <kmays2000@gmail.com>
Approved by: Joshua M. Clulow <josh@sysmgr.org>
Diffstat (limited to 'usr/src/lib/libsldap/common/ns_crypt.c')
-rw-r--r-- | usr/src/lib/libsldap/common/ns_crypt.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/usr/src/lib/libsldap/common/ns_crypt.c b/usr/src/lib/libsldap/common/ns_crypt.c index 69aa4b749e..49a708f9ee 100644 --- a/usr/src/lib/libsldap/common/ns_crypt.c +++ b/usr/src/lib/libsldap/common/ns_crypt.c @@ -83,8 +83,8 @@ static int unhex(char c) { return (c >= '0' && c <= '9' ? c - '0' - : c >= 'A' && c <= 'F' ? c - 'A' + 10 - : c - 'a' + 10); + : c >= 'A' && c <= 'F' ? c - 'A' + 10 + : c - 'a' + 10); } @@ -98,7 +98,7 @@ ascii2hex(char *anHexaStr, int *aResLen) return (NULL); while (isxdigit(*anHexaStr)) { theRes[theLen] = unhex(*anHexaStr) << 4; - if (++anHexaStr != '\0') { + if (*(++anHexaStr) != '\0') { theRes[theLen] += unhex(*anHexaStr); anHexaStr++; } @@ -169,18 +169,20 @@ modvalue(char *str, int len, int *mod_len) n2 = 0; if ((s = (char *)malloc(2 * len + 1)) != NULL) { while (i < len) { - s[i] = t2[(t3[(t1[(str[i]+n1)&MASK]+n2)&MASK]-n2)&MASK]-n1; - i++; - n1++; - if (n1 == ROTORSIZE) { - n1 = 0; - n2++; - if (n2 == ROTORSIZE) n2 = 0; - } + s[i] = + t2[(t3[(t1[(str[i]+n1)&MASK]+n2)&MASK]-n2)&MASK]-n1; + i++; + n1++; + if (n1 == ROTORSIZE) { + n1 = 0; + n2++; + if (n2 == ROTORSIZE) + n2 = 0; + } } s[i] = '\0'; if (mod_len != NULL) - *mod_len = i; + *mod_len = i; } return (s); } |