Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions simavr/sim/sim_hex.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,12 @@ read_ihex_chunks(
allocation += INCREMENT;
chunk = realloc(chunk, allocation + (sizeof *chunk - 1));

/* Update the pointer in the previous list element */
if ( backlink_p ) backlink_p->next = chunk;
/* Update the pointer in the previous list element or root */
if ( backlink_p ) {
backlink_p->next = chunk;
} else {
*chunks_p = chunk;
}

/* Refresh the pointer to the future chunk */
chunks_p = &chunk->next;
Expand Down