I am editing the tag information at the end of an MP3 file. When I use fwrite to change, for example, the title and artist, if the title/artist is not the same length as before, it overlaps with existing data.
Ex: Title: Example Song
fwrite("Example Song 2", 30, 1, filename);
...new title does not use all thirty bytes.
Is there a way to pad the string before writing to get it to be thirty bytes? Or how can I erase the existing thirty bytes allocated for title and write my new title back to the file?