/* Copyright (c) 2002-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "buffer.h"
#include "printf-format-fix.h"
#include "str.h"
#include <stdio.h>
{
/* never allocate a 0 byte size buffer. this is especially important
when str_c() is called on an empty string from a different stack
frame (see the comment in buffer.c about this). */
}
{
return ret;
}
{
}
{
}
{
return;
}
{
/* remove the \0 - we don't want to keep it */
}
}
{
str_add_nul(*str);
return buffer_free_without_data(str);
}
{
}
{
}
{
return FALSE;
}
{
const char *p;
if (p == NULL)
else
}
{
}
{
char *tmp;
/* 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. */
/* @UNSAFE */
/* avoid growing buffer larger if possible. this is also
required if buffer isn't dynamically growing. */
}
/* didn't fit with the first guess. now we know the size,
so try again. */
}
/* drop the unused data, including terminating NUL */
}