[Gvpr] 'sprintf' does not work as it is documented with certain parameters
Ported Issue from Mantis Original ID: 2567 Reported By: szabi
SEVERITY: CRITICAL Submitted: 2015-08-27 20:14:41
OS: MAC OSX
OS BUILD: 10.10.3
DESCRIPTION
While 'printf' works as it should (= as in C), 'sprint' severely corrupts the output string with certain input parameters.
STEPS TO REPRODUCE
BEGIN {
string e (obj_t o, string aname) {
if (hasAttr(o, aname)) {return aget(o, aname); }
else {return "_"; }
}
string fmt = '<B>%s</B><BR/>%s<BR/><FONT POINT-SIZE="10">S: %s<BR/>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();
}
ADDITIONAL INFORMATION
Run on any graph, e.g. even as simple as
strict digraph Test {
A [ label = "A"]
beta [ label = "β"]
A -> beta
}
Edited by Matthew Fernandez