Revision 534e126a src/Tests/topology_test_th.c

View differences:

src/Tests/topology_test_th.c
83 83

  
84 84
static void *cycle_loop(void *p)
85 85
{
86
  char addr[256];
86 87
  int done = 0;
87 88
  int cnt = 0;
88
  
89

  
89 90
  while (!done) {
90 91
    const int tout = 1;
91 92

  
......
100 101
      neighbours = psample_get_cache(context, &n);
101 102
      printf("I have %d neighbours:\n", n);
102 103
      for (i = 0; i < n; i++) {
103
        printf("\t%d: %s\n", i, node_addr(neighbours[i]));
104
        node_addr(neighbours[i], addr, 256);
105
        printf("\t%d: %s\n", i, addr);
104 106
      }
105 107
      fflush(stdout);
106 108
      if (fprefix) {
......
111 113
        f = fopen(fname, "w");
112 114
        if (f) fprintf(f, "#Cache size: %d\n", n);
113 115
        for (i = 0; i < n; i++) {
114
          if (f) fprintf(f, "%d\t\t%d\t%s\n", port, i, node_addr(neighbours[i]));
116
          node_addr(neighbours[i], addr, 256);
117
          if (f) fprintf(f, "%d\t\t%d\t%s\n", port, i, addr);
115 118
        }
116 119
        fclose(f);
117 120
      }
......
130 133
  int done = 0;
131 134
#define BUFFSIZE 1024
132 135
  static uint8_t buff[BUFFSIZE];
133
  
136

  
134 137
  while (!done) {
135 138
    int len;
136 139
    struct nodeID *remote;

Also available in: Unified diff