diff --git a/program/src/rrd_info.c b/program/src/rrd_info.c
index 83364d20688714a006575862bd1bda413ac28f06..9ea68d4c7e3cefdba7151fb8b11b7dd3bd5be5e4 100644 (file)
--- a/program/src/rrd_info.c
+++ b/program/src/rrd_info.c
char *fmt,
...)
{
- int maxlen = 1024 + strlen(fmt);
char *str = NULL;
va_list argp;
+#ifdef HAVE_VASPRINTF
+ va_start( argp, fmt );
+ vasprintf( &str, fmt, argp );
+#else
+ int maxlen = 1024 + strlen(fmt);
str = (char*)(malloc(sizeof(char) * (maxlen + 1)));
if (str != NULL) {
va_start(argp, fmt);
vsprintf(str, fmt, argp);
#endif
}
+#endif // HAVE_VASPRINTF
va_end(argp);
return str;
}