Fix RGBLINK incorrectly reading file stack nodes

This caused node IDs to mismatch, yielding possibly corrupted file stacks
Worst part is, the docs mentioned the reading order had to be reversed...
This commit is contained in:
ISSOtm
2020-11-04 02:52:06 +01:00
parent dc96cc6d1e
commit b6bf7ae620

View File

@@ -497,7 +497,7 @@ void obj_ReadFile(char const *fileName, unsigned int fileID)
if (!nodes[fileID].nodes) if (!nodes[fileID].nodes)
err(1, "Failed to get memory for %s's nodes", fileName); err(1, "Failed to get memory for %s's nodes", fileName);
verbosePrint("Reading %u nodes...\n", nodes[fileID].nbNodes); verbosePrint("Reading %u nodes...\n", nodes[fileID].nbNodes);
for (uint32_t i = 0; i < nodes[fileID].nbNodes; i++) for (uint32_t i = nodes[fileID].nbNodes; i--; )
readFileStackNode(file, nodes[fileID].nodes, i, fileName); readFileStackNode(file, nodes[fileID].nodes, i, fileName);
/* This file's symbols, kept to link sections to them */ /* This file's symbols, kept to link sections to them */