Skip to content

Commit

Permalink
Fix populateNode() to properly store the nameLen
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Montellese <eric.montellese@hologic.com>
  • Loading branch information
eric-hologic authored and erikbosch committed Oct 16, 2024
1 parent b9d0193 commit 9ee2b08
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion binary/c_parser/cparserlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 9ee2b08

Please sign in to comment.