Revision dc877c50

View differences:

som/TopologyManager/topo_proto.c
24 24
  uint8_t *p = payload;
25 25

  
26 26
  p += cache_header_dump(p, c);
27
  p += entry_dump(p, myEntry, 0);
27
  p += entry_dump(p, myEntry, 0, size - (p - payload));
28 28
  for (i = 0; nodeid(c, i); i++) {
29 29
    if (!nodeid_equal(nodeid(c, i), snot)) {
30
      if (p - payload > size - 32 /* FIXME */) {
30
      int res;
31
      res = entry_dump(p, c, i, size - (p - payload));
32
      if (res < 0) {
31 33
        fprintf(stderr, "too many entries!\n");
32 34
        return -1;
33 35
      }
34
      p += entry_dump(p, c, i);
36
      p += res;
35 37
    }
36 38
  }
37 39

  

Also available in: Unified diff