[PATCH] Fixing dive notes escape characters in World map exporter
Dirk Hohndel
dirk at hohndel.org
Thu Apr 3 09:13:22 PDT 2014
On Tue, 2014-04-01 at 21:36 +0200, Gehad wrote:
> I couldn't find an easy way to use the memBuffer but I added Miika's
> optimization, and fixed the memory leak. I think this is working fine.
+ char* temp = malloc(new_size);
...
+ strcpy(temp, str);
This is wrong (not in a bad way, but wasteful). You don't need new_size
for temp as that's just used to hold a copy of the original string.
char *temp = strdup(str);
Lubomir was kind enough to address all the formatting issues with the
patch.
/D
More information about the subsurface
mailing list