I get a malloc error when I try to add a repeated message element.

Below is the .proto message definition:

message Discovery
{
  uint32 lmuSerialNumber = 1; 
  uint64 gpsTime = 2; 
  repeated EquipmentInfo discoveredUnits = 3;  
}

Here is the code where I'm trying to add discoveredUnits to the message:

for (int i = 0; i < numOfAssocMotes; i++)
{
EquipmentInfo* assocUnitInfo = 
outAssocUnitDiscoveryMsg.add_associatedunits();
assocUnitInfo->set_unitserialnumber(mySerialNum);
assocUnitInfo->set_latitude(myLatitude);
assocUnitInfo->set_longitude(myLongitude);
}

I get the malloc error when the add_associatedunits() function is called.

Thanks,
Doug

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to