summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2d69b08)
raw | patch | inline | side by side (parent: 2d69b08)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Fri, 1 Feb 2008 06:52:56 +0000 (06:52 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Fri, 1 Feb 2008 06:52:56 +0000 (06:52 +0000) |
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@1274 a5681a0c-68f1-0310-ab6d-d61299d08faa
src/rrd_graph.c | patch | blob | history |
diff --git a/src/rrd_graph.c b/src/rrd_graph.c
index bb7b1b6606e9c8f3c91f430320d434b86a5270c6..96f859b0f2de5d63488ffbe81fab87411d9cedd0 100644 (file)
--- a/src/rrd_graph.c
+++ b/src/rrd_graph.c
case 'n':{
char prop[15];
double size = 1;
- char font[1024] = "";
-
+ int end;
if(sscanf(optarg,
- "%10[A-Z]:%lf:%1000s",
- prop,&size,font) >= 2){
+ "%10[A-Z]:%lf%n",
+ prop,&size,&end) >= 2){
int sindex,propidx;
if((sindex=text_prop_conv(prop)) != -1){
for (propidx=sindex;propidx<TEXT_PROP_LAST;propidx++){
if (size > 0){
im->text_prop[propidx].size=size;
- }
- if (strlen(font) > 0){
- strcpy(im->text_prop[propidx].font,font);
+ }
+ if (strlen(prop) > end){
+ if (prop[end] == ':'){
+ strncpy(im->text_prop[propidx].font,prop+end+1,255);
+ im->text_prop[propidx].font[255] = '\0';
+ } else {
+ rrd_set_error("expected after font size in '%s'",prop);
+ return;
+ }
}
if (propidx==sindex && sindex != 0) break;
}