[rrd-developers] LEGEND length limit on systems with snprintf (HACK)

Tobias Oetiker tobi at oetiker.ch
Fri Nov 27 08:05:40 CET 2015


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
> rrd-developers at lists.oetiker.ch
> https://lists.oetiker.ch/cgi-bin/listinfo/rrd-developers
>
>

-- 
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
www.oetiker.ch tobi at oetiker.ch +41 62 775 9902



More information about the rrd-developers mailing list