/* Copyright (c) 2002-2018 Dovecot authors, see the included COPYING file */
/* @UNSAFE: whole file */
#include "lib.h"
#include "printf-format-fix.h"
#include "strfuncs.h"
#include "array.h"
#include <stdio.h>
#include <limits.h>
#include <ctype.h>
enum _str_trim_sides {
};
volatile int timing_safety_unoptimization;
{
int ret;
args);
}
{
void *mem;
return NULL;
return mem;
}
{
void *mem;
return mem;
}
{
return NULL;
}
{
char *mem;
return mem;
}
{
char *mem;
len = 0;
len++;
return mem;
}
{
char *ret;
return ret;
}
unsigned int *size_r)
{
char *tmp;
int ret;
#ifdef DEBUG
#endif
/* the format string is modified only if %m exists in it. it happens
only in error conditions, so don't try to t_push() here since it'll
just slow down the normal code path. */
/* didn't fit with the first guess. now we know the size,
so try again. */
}
#ifdef DEBUG
/* we rely on errno not changing. it shouldn't. */
#endif
return tmp;
}
{
unsigned int size;
if (pool->datastack_pool) {
return tmp;
} else {
return buf;
}
}
{
const char *str;
char *temp;
i = 0;
do {
/* need more memory */
}
/* next string */
temp[i++] = '\0';
*ret_len = i;
return temp;
}
{
if (pool->datastack_pool) {
} else {
}
return ret;
}
{
}
{
}
{
}
{
}
{
}
{
const char *ret;
return ret;
}
{
}
{
const char *ret;
return ret;
}
{
const char *p;
for (p = str; *p != '\0'; p++) {
if (*p == cutchar)
return t_strdup_until(str, p);
}
return str;
}
{
char *out;
return str;
for (i = 0; i < len; i++) {
else
}
out[i] = '\0';
return out;
}
{
if (dstsize == 0)
return -1;
dstsize--;
}
*dest = '\0';
}
{
char *p;
for (p = str; *p != '\0'; p++)
*p = i_toupper(*p);
return str;
}
{
char *p;
for (p = str; *p != '\0'; p++)
*p = i_tolower(*p);
return str;
}
{
}
{
}
{
return;
p = str;
if ((sides & STR_TRIM_LEFT) != 0) {
p++;
if (p == pend)
return;
}
begin = p;
p = pend;
if ((sides & STR_TRIM_RIGHT) != 0) {
p--;
if (p == begin)
return;
}
end = p;
}
{
return "";
}
{
return "";
}
{
return "";
return begin;
}
{
}
{
}
{
return "";
}
{
return "";
}
{
return 1;
}
{
return 1;
}
{
int ret;
while (size > 0) {
if (ret != 0)
return ret;
}
return 0;
}
{
}
{
}
{
size_t i;
int ret = 0;
for (i = 0; i < size; i++)
/* make sure the compiler optimizer doesn't try to break out of the
above loop early. */
return ret == 0;
}
static char **
{
char **array;
char *str;
if (spaces) {
/* skip leading separators */
data++;
}
if (*data == '\0')
alloc_count = 32;
while (*str != '\0') {
/* separator found */
sizeof(char *) * alloc_count,
sizeof(char *) *
}
*str = '\0';
if (spaces) {
str++;
/* ignore trailing separators */
break;
}
}
str++;
}
return array;
}
static char **
{
if (*data == '\0')
alloc_count = 32;
/* separator found */
sizeof(char *) * alloc_count,
sizeof(char *) *
}
*str++ = '\0';
}
return array;
}
static char **
{
else
}
{
separators, FALSE);
}
{
separators, TRUE);
}
{
}
const char *separators)
{
}
{
}
{
unsigned int count;
return 0;
count++;
return count;
}
static char *
const char *separator)
{
unsigned int i;
char *str;
alloc_len = 64;
pos = 0;
for (i = 0; i < arr_len; i++) {
if (needed_space > alloc_len) {
}
if (i != 0) {
}
}
if (!pool->datastack_pool)
return str;
}
{
}
{
const char **dest;
/* found it. now move the rest. */
return TRUE;
}
}
return FALSE;
}
{
return TRUE;
}
return FALSE;
}
{
return TRUE;
}
return FALSE;
}
{
unsigned int i;
const char **ret;
char *p;
/* @UNSAFE: integer overflow checks are missing */
ret[i] = p;
p += len;
}
return ret;
}
{
}
{
int pos;
do {
number /= 10;
}
const char *separator)
{
if (array_count(arr) == 0)
return "";
}