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

using sizeof(struct foo) is a bad idea for serialization #47

Open
schwehr opened this issue Jul 10, 2015 · 1 comment
Open

using sizeof(struct foo) is a bad idea for serialization #47

schwehr opened this issue Jul 10, 2015 · 1 comment

Comments

@schwehr
Copy link
Owner

schwehr commented Jul 10, 2015

The character array needs to be 13 to allow for a trailing \0. However, that bumps the struct size up to 16 causing the gsf write code to write a 16 byte block instead of the original 12.

gsfHeader uses the size of the struct to determine the size of what to write.

@schwehr schwehr changed the title gsfHeader uses the size of the struct to determine the size of what to write. using sizeof(struct foo) is a bad idea for serialization Jul 10, 2015
@schwehr
Copy link
Owner Author

schwehr commented Jul 10, 2015

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

No branches or pull requests

1 participant