Revision 74fffd00 net_helper-ml.c

View differences:

net_helper-ml.c
481 481
{
482 482
  socketID_To_String(s->addr,(char *)b,SOCKETID_STRING_SIZE);
483 483
  //fprintf(stderr,"Dumping nodeID : ho scritto %s (%d bytes)\n",b, strlen((char *)b));
484
  return strlen((char *)b);
485 484

  
486 485
//	memcpy(b, s->addr,SOCKETID_SIZE);//sizeof(struct sockaddr_in6)*2
487 486
//	return SOCKETID_SIZE;//sizeof(struct sockaddr_in6)*2;
488 487

  
488
  return 1 + strlen((char *)b);	//terminating \0 IS included in the size
489 489
}
490 490

  
491 491
struct nodeID *nodeid_undump(const uint8_t *b, int *len)
......
499 499
		  memset(res->addr,0,SOCKETID_SIZE);
500 500
		  //memcpy(res->addr, b, SOCKETID_SIZE);
501 501
		  //*len = SOCKETID_SIZE;
502
		  *len = strlen((char*)b);
502
		  *len = strlen((char*)b) + 1;
503 503
		  string_To_SocketID((char *)b,res->addr);
504 504
	//	  fprintf(stderr,"Node undumped : %s\n",node_addr(res));
505 505
	//	  res->addrSize = SOCKETID_SIZE;

Also available in: Unified diff