char *parse_dn;
bool is_index;
- if (dn == NULL || dn->invalid == true) {
+ if (dn == NULL || dn->invalid) {
return false;
}
}
/* Special DNs case */
- if (dn->special == true) {
+ if (dn->special) {
return true;
}
d = dt = data;
while (*p) {
- if (in_extended == true) {
+ if (in_extended) {
if (!in_ex_name && !in_ex_value) {
*d++ = *p++;
continue;
}
- if (in_attr == true) {
- if (trim == true) {
+ if (in_attr) {
+ if (trim) {
if (*p == ' ') {
p++;
continue;
goto failed;
}
- if (is_oid == true && ( ! (isdigit(*p) || (*p == '.')))) {
+ if (is_oid && ( ! (isdigit(*p) || (*p == '.')))) {
/* not a digit nor a dot,
* invalid attribute oid */
ldb_dn_mark_invalid(dn);
continue;
}
- if (in_value == true) {
- if (in_quote == true) {
+ if (in_value) {
+ if (in_quote) {
if (*p == '\"') {
if (p[-1] != '\\') {
p++;
continue;
}
- if (trim == true) {
+ if (trim) {
if (*p == ' ') {
p++;
continue;
*/
case ',':
- if (escape == true) {
+ if (escape) {
*d++ = *p++;
l++;
escape = false;
accept the base64 encoded binary index
values, which contain a '+' or '='
which should normally be escaped */
- if (is_index == true) {
+ if (is_index) {
if (t != NULL) {
t = NULL;
}
case '>':
case ';':
/* a string with not escaped specials is invalid (tested) */
- if (escape == false) {
+ if (!escape) {
ldb_dn_mark_invalid(dn);
goto failed;
}
break;
case '\\':
- if (escape == false) {
+ if (!escape) {
escape = true;
p++;
continue;
break;
default:
- if (escape == true) {
+ if (escape) {
if (isxdigit(p[0]) && isxdigit(p[1])) {
if (sscanf(p, "%02x", &x) != 1) {
/* invalid escaping sequence */
}
}
- if (in_attr == true || in_quote == true) {
+ if (in_attr || in_quote) {
/* invalid dn */
ldb_dn_mark_invalid(dn);
goto failed;
}
- if (in_value == true) {
+ if (in_value) {
/* save last element */
if (t != NULL) {
/* trim back */