Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail on empty line of s-record. #18

Open
bicyclesonthemoon opened this issue May 22, 2020 · 1 comment
Open

Fail on empty line of s-record. #18

bicyclesonthemoon opened this issue May 22, 2020 · 1 comment
Assignees
Labels

Comments

@bicyclesonthemoon
Copy link
Contributor

Some tools produce s-record (or hex) files which have an additonal empty line(s) at the end.
rl78flash will not accept such otherwise perfectly valid file.

It makes much more sense to accept these files than having to edit each file every time a software is released.
Empty lines can be safely ignored.

I am dealing with it by skiping the line if first character is '\r' or '\n':
in srec.c:
if ('S' != line[0])
{
if ('\r' == line[0] || '\n' == line[0])
{
break;
}
fprintf(stderr, "File format error (\"%s\")\n", line);
rc = SREC_FORMAT_ERROR;
break;
}
(I don't know why github is misformatting the indentation)

similarly for intel hex:
if (':' != line[0])
{
if ('\r' == line[0] || '\n' == line[0])
{
break;
}
fprintf(stderr, "File format error (\"%s\")\n", line);
rc = SREC_FORMAT_ERROR;
break;
}

(BTW, I wrote some questions in my pull request for intel hex support)

@msalau msalau self-assigned this Jul 28, 2020
@msalau msalau added the bug label Jul 28, 2020
@bicyclesonthemoon
Copy link
Contributor Author

Related to this issue:
When last line of srec file does not end with a newline character, the error message is misleading:
"Unable to parse file: line is too long\n".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants