list: fix list element counting in provided example inside _info file
authorVladimir Zapolskiy <vz@mleia.com>
Tue, 22 Nov 2011 23:58:15 +0000 (01:58 +0200)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 23 Nov 2011 02:34:21 +0000 (13:04 +1030)
This change initializes a counter of children, otherwise is may contain
arbitrary value.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
ccan/list/_info

index 8b5bd9b5e15a336fbb464ba66bc4d7de7e5d955e..a30659c1cf694e0f1350ab9719f86c01b45a5c07 100644 (file)
@@ -38,6 +38,7 @@
  *
  *             p.name = argv[1];
  *             list_head_init(&p.children);
  *
  *             p.name = argv[1];
  *             list_head_init(&p.children);
+ *             p.num_children = 0;
  *             for (i = 2; i < argc; i++) {
  *                     c = malloc(sizeof(*c));
  *                     c->name = argv[i];
  *             for (i = 2; i < argc; i++) {
  *                     c = malloc(sizeof(*c));
  *                     c->name = argv[i];