#include "common/macros.h"
#include "common/common.h"
#include "compat/unistd.h"
+#include "compat/limits.h"
#ifndef __MINGW32__
#include <pwd.h>
/* Resize. */
g_string_set_size(str, len + print_len);
va_start(ap, fmt);
- print_len = vsprintf(str->str + len, fmt, ap);
+ print_len = vsnprintf(str->str + len, print_len + 1, fmt, ap);
va_end(ap);
} else {
str->len = len + print_len;