X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_info.c;h=13d30a6cd37fed0a5d70b3376882adaf7c68b1b5;hb=daf8e7ff715a59e1f9827080d1b785ffb3c5a4b1;hp=e0bcefa0a95b524a989f76e8934aecffde8000dd;hpb=e3be7f72da32514252efa014a2f35538319d098e;p=rrdtool.git diff --git a/src/rrd_info.c b/src/rrd_info.c index e0bcefa..13d30a6 100644 --- a/src/rrd_info.c +++ b/src/rrd_info.c @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.2.99907080300 Copyright by Tobi Oetiker, 1997-2007 + * RRDtool 1.3rc7 Copyright by Tobi Oetiker, 1997-2008 ***************************************************************************** * rrd_info Get Information about the configuration of an RRD *****************************************************************************/ @@ -20,18 +20,14 @@ char *sprintf_alloc( char *fmt, ...) { -#ifdef HAVE_VSNPRINTF - int maxlen = 50; -#else - int maxlen = 1000; -#endif + int maxlen = 1024 + strlen(fmt); char *str = NULL; va_list argp; - str = malloc(sizeof(char) * (strlen(fmt) + maxlen)); + str = malloc(sizeof(char) * (maxlen+1)); if (str != NULL) { va_start(argp, fmt); #ifdef HAVE_VSNPRINTF - vsnprintf(str, maxlen - 1, fmt, argp); + vsnprintf(str, maxlen, fmt, argp); #else vsprintf(str, fmt, argp); #endif @@ -334,8 +330,6 @@ info_t *rrd_info_r( void info_print( info_t *data) { - long image_length = 0; - while (data) { printf("%s = ", data->key);