]>
granicus.if.org Git - graphviz/commit
tools: initialize a variable
Squashing
warning: ‘sym’ may be used uninitialized in this function
Here was no real usage of uninitialized variable, but
compiler still complains.
Pointer sym is allocated when flag with_val is set:
if (with_val) {
sym = agattr(g, AGEDGE, "len", "1");
}
So just squash the warning by setting the
pointer to NULL and test it in guard condition
instead of testing the flag:
if (sym && val) {
sprintf(buf, "%f", val[j]);
agxset(e, sym, buf);
}