sarah-walker-pcem / arculator

Arculator
http://b-em.bbcmicro.com/arculator
GNU General Public License v2.0
56 stars 23 forks source link

Fix append_filename() to work reliably #31

Closed sjnewbury closed 1 year ago

sjnewbury commented 1 year ago

sprintf() has undefined behaviour when destination and a source both point to the same buffer. This happens in podule-linux.c and causes random failures to find the podule shared objects as in https://github.com/sarah-walker-pcem/arculator/issues/11

Using strdup() to create temporary copies of the source buffers eliminates the undefined behaviour.