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

Allow for loading raw ROM dumps #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Allow for loading raw ROM dumps #8

wants to merge 1 commit into from

Conversation

flaviut
Copy link

@flaviut flaviut commented Aug 26, 2018

As a bonus feature, also report the error code when loading an object

As a bonus feature, also report the error code when loading an object
if (!f) return -1;

int address = 0;
while (!feof(f))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This loop will happily try to write megabytes of stuff into memory.. it would probably be a good idea to limit read to the actual target buffer size.

FILE *f;
if (aFilename == 0 || aFilename[0] == 0)
return -1;
f = fopen(aFilename, "r");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use mode "rb" instead of "r", otherwise windows targets will just load garbage.

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

Successfully merging this pull request may close these issues.

2 participants