diff --git a/binary/c_parser/cparserlib.c b/binary/c_parser/cparserlib.c index c4e7db6f..4df0544c 100644 --- a/binary/c_parser/cparserlib.c +++ b/binary/c_parser/cparserlib.c @@ -352,7 +352,9 @@ char* extractAllowedElement(char* allowedBuf, int elemIndex) { } void populateNode(node_t* thisNode) { - ret = fread(&(thisNode->nameLen), sizeof(uint8_t), 1, treeFp); + uint8_t nameLen; + ret = fread(&nameLen, sizeof(uint8_t), 1, treeFp); + thisNode->nameLen = nameLen; thisNode->name = (char*) malloc(sizeof(char)*(thisNode->nameLen+1)); ret = fread(thisNode->name, sizeof(char)*thisNode->nameLen, 1, treeFp); thisNode->name[thisNode->nameLen] = '\0';