Skip to content
Open
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
11 changes: 10 additions & 1 deletion engine/src/reader/format/ihex.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <ctype.h>

// Project Headers (engine, readers)
#include "engine/include/reader/format/ihex.h"
Expand Down Expand Up @@ -97,11 +98,19 @@ static int32_t read_ihex_file(const char *hex_file, vmcu_binary_buffer_t *bb, ui

FILE *f = NULL;
size_t len; char *line = NULL;
ssize_t nread;

if((f = fopen(hex_file, "r")) == NULL)
return -1;

while(getline(&line, &len, f) != -1) {
while((nread = getline(&line, &len, f)) != -1) {

size_t i = 0;
while(i < nread && (line[i++] != ':')){}

if (i == nread){
continue;
}

if(read_ihex_line(line, bb, size) < 0) {

Expand Down