/* Copyright (c) 2004-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "unichar.h"
#include "str.h"
#include "str-sanitize.h"
{
size_t i;
if (len <= 0)
break;
if ((unsigned char)src[i] < 32)
break;
i += len;
}
return i;
}
{
if (len == initial_pos)
return;
return;
}
/* truncate UTF-8 sequence. */
len--;
len--;
if (len >= initial_pos)
}
{
size_t i;
if (len == 0)
break; /* input ended too early */
if (len < 0) {
/* invalid UTF-8 */
i++;
continue;
}
if ((unsigned char)src[i] < 32)
else
i += len;
}
if (src[i] != '\0') {
if (max_bytes < 3)
else {
}
}
}
{
size_t i;
return NULL;
if (src[i] == '\0')
return src;
}