diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-06-24 05:17:36 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:18:46 -0500 |
commit | 49736de46a340ed9256d7a914631a67453aa7530 (patch) | |
tree | d3e561af29865b45dec56b9d7b9f309045b5e8f2 | |
parent | f04545f5d268b2e4515c463957600d562d75f9e1 (diff) | |
download | samba-49736de46a340ed9256d7a914631a67453aa7530.tar.gz samba-49736de46a340ed9256d7a914631a67453aa7530.tar.bz2 samba-49736de46a340ed9256d7a914631a67453aa7530.zip |
r7873: hopefully fixed build of ldb_explode_dn() on AIX
I'd really rather see this code completely replaced, but I'll leave
that to simo (he has volunteered) :-)
(This used to be commit cc2e08d68e27aa203ccc26e8d544a86de3399877)
-rw-r--r-- | source4/lib/ldb/common/ldb_explode_dn.c | 36 |
1 files changed, 9 insertions, 27 deletions
diff --git a/source4/lib/ldb/common/ldb_explode_dn.c b/source4/lib/ldb/common/ldb_explode_dn.c index 0dcca5dc70..0e2efa876c 100644 --- a/source4/lib/ldb/common/ldb_explode_dn.c +++ b/source4/lib/ldb/common/ldb_explode_dn.c @@ -35,7 +35,6 @@ * Author: Derrell Lipman */ -#include <ctype.h> #include "includes.h" #include "ldb/include/ldb.h" #include "ldb/include/ldb_private.h" @@ -496,35 +495,18 @@ failed: } -static char * -parse_slash(char *p, - char *end) +static char *parse_slash(char *p, char *end) { - switch (*(p + 1)) { - case ',': - case '=': - case '\n': - case '+': - case '<': - case '>': - case '#': - case ';': - case '\\': - case '"': + unsigned x; + if (strchr(",=\n+<>#;\\\"", p[1])) { memmove(p, p + 1, end - (p + 1)); return (end - 1); - - default: - if (isxdigit(p[1]) && isxdigit(p[2])) { - int x; - - sscanf(p + 1, "%02x", &x); - *p = (char) x; - memmove(p + 1, p + 3, end - (p + 3)); - return (end - 2); - } else { - return NULL; - } } + if (sscanf(p + 1, "%02x", &x) == 1) { + *p = (unsigned char)x; + memmove(p + 1, p + 3, end - (p + 3)); + return (end - 2); + } + return NULL; } |