Sometimes what a RMC client wants is just fetch a file blob and treat content as a string. But in this case a client has to re-alloc memory to add a '\0' at the end of string. I think RMC library can always alloc one extra byte of true length of file blob, and always set '\0' in the last byte. The true length of file blob will be still returned without +1 to be compatible for other scenarios. With this trick, clients won't need to copy the content when they only want to read string. Freeing memory allocated by RMC API shouldn't be affected since free functions don't take length.
This task depends on the major change tracked in 10086.
Performance can be also improved in write_fingerprint_file (src/rmc.c). Please see the TODO comment.
Does not apply to RMC2.