Ticket #95 (closed defect: wontfix)

Opened 5 years ago

Last modified 5 years ago

xgrid parsing in librrd

Reported by: human Owned by: oetiker
Priority: trivial Milestone:
Component: rrd_graph Version:
Keywords: x-grid Cc:

Description

Hi Tobi, i had a problem submitting a x-grid string to the rrd_graph function in a C program. Whatever i tried (except '-x none'), i got "invalid x-grid format" if i used the whole "-x GTM:GST:MTM:MST:LTM:LST:LPR:LFM" string as an argv[] entry. Looking in the source of rrd_graph.c i found that you use "%10[A-Z]..." for the sscanf function. As of the man page of sscanf, that doesn't "strip" whitespaces from the beginning of the string to parse ("... The usual skip of leading white space is suppressed..."). Changing the format string to " %10[A-Z]..." (adding a space at the beginning) solved that issue. Splitting the option into two strings ("-x" and "GTM:GST:MTM:MST:LTM:LST:LPR:LFM") for argv[] to rrd_graph() seems to work too. I will use the second workaround for now, but it would be great to take care of that.

Thanks Mario mjentsch at cogentco dot com

Change History

comment:1 Changed 5 years ago by oetiker

  • Status changed from new to closed
  • Resolution set to wontfix

Mario, this is the intended behaviour ... valid formats are

-sARG --long=ARG -s ARG --long ARG

where white space means a split in the argument ...

if you send

"-s ARG" as one argument this is essentially "-s"," ARG" which is just wrong

cheers tobi

--long-option=xyx

Note: See TracTickets for help on using tickets.

NOTE: The content of this website is accessible with any browser. The graphical design though relies completely on CSS2 styles. If you see this text, this means that your browser does not support CSS2. Consider upgrading to a standard conformant browser like Mozilla Firefox or Opera but also Apple's Safari or KDE's Konqueror for example. It may also be that you are looking at a mirror page which did not copy the CSS for this page. Or if some pictu res are missing, then the mirror may not have picked up the contents of the inc directory.