Graphviz Issue Tracker - graphviz
View Issue Details
0002567graphvizGvprpublic2015-08-27 15:142015-08-27 15:18
szabi 
 
normalcriticalalways
newopen 
Mac OSX10.10.3
0002567: 'sprintf' does not work as it is documented with certain parameters
While 'printf' works as it should (= as in C), 'sprint' *severely* corrupts the output string with certain input parameters.

BEGIN {
  string e (obj_t o, string aname) {
    if (hasAttr(o, aname)) {return aget(o, aname); }
    else {return "_"; }
  }
  string fmt = '%s
%s
<FONT POINT-SIZE="10">S: %s
P: %s</FONT>'
}
N { printf(fmt, e($, "name"), e($, "shape"), e($, "attr3"), e($, "attr4")) ;
    print();
    print(sprintf(fmt, e($, "name"), e($, "shape"), e($, "attr3"), e($, "attr4")) );
    print();
  }
Run on any graph, e.g. even as simple as


strict digraph Test {
  A [ label = "A"]
  beta [ label = "β"]
  A -> beta
}
No tags attached.
? bug.gvpr (410) 2015-08-27 15:17
http://www.graphviz.org/mantisbt/file_download.php?file_id=475&type=bug
Issue History
2015-08-27 15:14szabiNew Issue
2015-08-27 15:17szabiNote Added: 0000966
2015-08-27 15:17szabiFile Added: bug.gvpr

Notes
(0000966)
szabi   
2015-08-27 15:17   
I see the 'gvpr' source I input got corrupted (of course, < > brackets...)

I'm uploading now as an attachment.