char *file;
int index;
char draw_def[64];
+ char legend[256];
if ((def == NULL) || (ident == NULL) || (args == NULL))
return (EINVAL);
DEBUG ("gl_ident_get_rrdargs: file = %s;\n", file);
+ if (def->legend != NULL)
+ {
+ strncpy (legend, def->legend, sizeof (legend));
+ legend[sizeof (legend) - 1] = 0;
+ }
+ else
+ {
+ ident_describe (ident, def->select,
+ legend, sizeof (legend));
+
+ if ((legend[0] == 0) || (strcmp ("default", legend) == 0))
+ {
+ strncpy (legend, def->ds_name, sizeof (legend));
+ legend[sizeof (legend) - 1] = 0;
+ }
+ }
+
index = args->index;
args->index++;
array_prepend_format (args->lines, "GPRINT:vdef_%04i_min:%s min,",
index, (def->format != NULL) ? def->format : "%6.2lf");
array_prepend_format (args->lines, "LINE1:%s#%06"PRIx32":%s",
- draw_def, def->color,
- (def->legend != NULL) ? def->legend : def->ds_name);
+ draw_def, def->color, legend);
free (file);