Re: LEGEND length limit on systems with snprintf (HACK)

Tobias Oetiker <[email protected]> Fri, 27 Nov 2015 08:05:40 +0100 (CET)
Newsgroups gmane.comp.db.rrdtool.devel
Message-ID <alpine.DEB.2.20.1511270804410.11644@engelberg>
Hi Markus,

makeing this allocated memory sounds like a good plan ... a patch
for the master branch would be a cool thing.

cheers
tobi


Yesterday Markus Weber wrote:

> Maybe helpful for others trying to use large legends (or legends with lot of
> markup stuff):
>
> On systems with snprintf, the length of the legend "input" (before markup) is
> truncated to 200 chars, which might not be long enough in some cases (at least
> not for me at the moment). This is more a "hack" rather than a real fix (which
> would probably to use dynamically allocated buffers, but gives some more room
> for fancy formatted legends.
>
> Cheers,
> Markus
>
> *** ../../../rrdtool-1.5.5/src/rrd_graph.h      Tue Nov 10 17:15:18 2015
> --- rrd_graph.h Wed Nov 25 10:46:27 2015
> ***************
> *** 197,203 ****
>      because they are quite diverse, not all elements will use all the
>      possible parts of the structure. */
>   #ifdef HAVE_SNPRINTF
> ! #define FMT_LEG_LEN 200
>   #else
>   #define FMT_LEG_LEN 2000
>   #endif
> --- 197,203 ----
>      because they are quite diverse, not all elements will use all the
>      possible parts of the structure. */
>   #ifdef HAVE_SNPRINTF
> ! #define FMT_LEG_LEN 500
>   #else
>   #define FMT_LEG_LEN 2000
>   #endif
>
> _______________________________________________
> rrd-developers mailing list
> [email protected]
> https://lists.oetiker.ch/cgi-bin/listinfo/rrd-developers
>
>

-- 
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
www.oetiker.ch [email protected] +41 62 775 9902