Revision 534e126a src/Tests/topology_test_attr.c

View differences:

src/Tests/topology_test_attr.c
78 78
static struct nodeID *init(void)
79 79
{
80 80
  struct nodeID *myID;
81
  char addr[256];
81 82

  
82 83
  myID = net_helper_init(my_addr, port, "");
83 84
  if (myID == NULL) {
......
86 87
    return NULL;
87 88
  }
88 89

  
89
  strcpy(my_attr.name, node_addr(myID));
90
  node_addr(myID, addr, 256);
91
  strcpy(my_attr.name, addr);
90 92
  context = psample_init(myID, &my_attr, sizeof(struct peer_attributes), "");
91 93

  
92 94
  return myID;
......
132 134
  int done = 0;
133 135
#define BUFFSIZE 1024
134 136
  static uint8_t buff[BUFFSIZE];
137
  char addr[256];
135 138
  int cnt = 0;
136
  
139

  
137 140
  psample_parse_data(context, NULL, 0);
138 141
  while (!done) {
139 142
    int len;
......
169 172
        }
170 173
        printf("I have %d neighbourhoods:\n", n);
171 174
        for (i = 0; i < n; i++) {
172
          printf("\t%d: %s", i, node_addr(neighbourhoods[i]));
175
          node_addr(neighbourhoods[i], addr, 256);
176
          printf("\t%d: %s", i, addr);
173 177
          if (meta) {
174 178
            printf("\tPeer %s is a %s peer and is %s", meta[i].name, meta[i].colour, status_print(meta[i].state));
175 179
          }

Also available in: Unified diff