We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c6343c1 commit a6fc4ccCopy full SHA for a6fc4cc
simavr/sim/sim_hex.c
@@ -172,8 +172,12 @@ read_ihex_chunks(
172
allocation += INCREMENT;
173
chunk = realloc(chunk, allocation + (sizeof *chunk - 1));
174
175
- /* Update the pointer in the previous list element */
176
- if ( backlink_p ) backlink_p->next = chunk;
+ /* Update the pointer in the previous list element or root */
+ if ( backlink_p ) {
177
+ backlink_p->next = chunk;
178
+ } else {
179
+ *chunks_p = chunk;
180
+ }
181
182
/* Refresh the pointer to the future chunk */
183
chunks_p = &chunk->next;
0 commit comments