[rrd-developers] Re: rrdtool-1.2.11 released

Stefan Moser sm at open.ch
Tue Jul 26 10:51:56 MEST 2005


Tobias Oetiker wrote:

> * changing just the font and not the size of the font as described
>   in the man page now actually works. -- Havard Eidnes

Hi Tobi,

Incidentally, I was just about to send you the exact same patch yesterday, but 
could just stop myself from hitting send. The problem with the current fix is 
that it relies on 'font' beeing initialized to an empty string before the call 
to sscanf:

   ...
   char font[1024];

   if(sscanf(optarg, "%10[A-Z]:%lf:%1000s", prop,&size,font) >= 2){
           ...
           if (strlen(font) > 0){
               strcpy(im->text_prop[propidx].font,font);
           }

However, sscanf doesn't touch 'font' if there are only two values to read, as in 
'--font TITLE:5:', and I can't see 'font' beeing initialized anywhere else. 
Under those circumstances, the following 'strlen(font)' is very courageous indeed.

Initializing 'font' should take care of this though:

    char font[1024] = "";

(also see attached patch file).

cheers
-stefan


-- Attached file removed by Ecartis and put at URL below --
-- Type: text/plain
-- Size: 451 bytes
-- URL : http://lists.ee.ethz.ch/p/rrd_graph.c.font-option.patch


--
Unsubscribe mailto:rrd-developers-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-developers-request at list.ee.ethz.ch?subject=help
Archive     http://lists.ee.ethz.ch/rrd-developers
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi



More information about the rrd-developers mailing list