Closed bturner1273 closed 4 years ago
The size does sound excessive. That is likely the input data. You copy 8 bytes to a struct I don't know the format of, and you do not make sure the string is terminated. You can use create_str_n for a purpose.
The buffer is also returned incorrectly. You either need uint8_t **buffer
and assign *buffer = finalize ...
and free it later with a flacc call, or or you must use another finalize call that takes a buffer as argument and the maximum capacity.
Thank you for the help! I replaced the create_str calls with create_strn and it made the size reasonable. Also fixed the buffer return!
you are welcome!
I have a table with 3 strings in it that are very short:
This is my schema:
This is my code to serialize the "APNSettings" table:
So testing this I load the settings.apn struct with
The size that is returned is equal to 3764: this seems way too large am I right?