Number: 576
Title: Missing label with multiples call to agwrite
Submitter: Celine
Date: Mon Nov 22 16:56:30 2004
Subsys: Lib(a)graph
Version: 1.17.20041122
System: x86-Linux-Debian unstable
Severity: major
Problem:
When constructing a graph, a first call to agwrite writes the correct graph. But if I add nodes later, a later call to agwrite renders a graph without label in further nodes.

File included output.txt is stdout.
Input:

#include <stdio.h>
#include <agraph.h>
int main (int argc, char** argv)
{
	Agraph_t *g;
	Agsym_t *symnlabel;
	g = agopen("Graph",Agundirected, 0);
	symnlabel = agattr(g,AGNODE,"label", "");

	char *tmp = "10.0.0.0 label";
	char *tmp2 = agstrdup_html(g, tmp);
	Agnode_t *n = agnode(g, "10.0.0.0",TRUE);
	agxset(n,symnlabel,tmp2);
	agwrite(g, stdout);

	tmp = "120.0.0.0 label";
	tmp2 = agstrdup_html(g, tmp);
	Agnode_t *n2 = agnode(g, "120.0.0.0",TRUE);
	agxset(n2,symnlabel,tmp2);

	agwrite(g, stdout);
}
Output file: b576.txt
Comments:
[erg] The use of HTML labels is irrelevant. The same effect occurs with ordinary strings.
Owner: *
Status: *