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

Markus Weber fvd at uucp.de
Thu Nov 26 10:59:53 CET 2015


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



More information about the rrd-developers mailing list