/* Ending NUL */
return -EINVAL;
- else if (*n == '\\' || *n == '.') {
+ else if (IN_SET(*n, '\\', '.')) {
/* Escaped backslash or dot */
if (d)
}
terminal = *label_terminal;
- assert(*terminal == '.' || *terminal == 0);
+ assert(IN_SET(*terminal, 0, '.'));
/* Skip current terminal character (and accept domain names ending it ".") */
if (*terminal == 0)
q = dest;
while (l > 0) {
- if (*p == '.' || *p == '\\') {
+ if (IN_SET(*p, '.', '\\')) {
/* Dot or backslash */
sz -= 2;
- } else if (*p == '_' ||
- *p == '-' ||
+ } else if (IN_SET(*p, '_', '-') ||
(*p >= '0' && *p <= '9') ||
(*p >= 'a' && *p <= 'z') ||
(*p >= 'A' && *p <= 'Z')) {