ssanthosh243 / semicomplete

Automatically exported from code.google.com/p/semicomplete
0 stars 0 forks source link

tsearch-example.c broken #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. compile with gcc tsearch-example.c
2. ./a.out
3. Notice bogus characters printed by the w function.

What is the expected output? What do you see instead?
w prints garbage.
A revised version of w:

void w(const void *node, const VISIT which, const int depth) {
  foo_t *f;
  f = (foo_t *)node; /* wrong */
  f = *(foo_t **)node; /* correct */
  printf("%s: %d\n", f->name, f->value);
}

What version of the product are you using? On what operating system?
ubuntu 9.10

Please provide any additional information below.
See corrected code above.

David Anderson

Original issue reported on code.google.com by dave...@gmail.com on 4 Apr 2010 at 3:03

GoogleCodeExporter commented 9 years ago
Thanks! Fixed in SVN.

Original comment by jls.semi...@gmail.com on 7 Apr 2010 at 11:59