/*
This file is part of LilyPond, the GNU music typesetter.
- Copyright (C) 2011 Reinhold Kainhofer <reinhold@kainhofer.com>
+ Copyright (C) 2011--2012 Reinhold Kainhofer <reinhold@kainhofer.com>
LilyPond is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
* though), we have to prepend it manually. */
if (g_without_BOM) // conversion to UTF-16be might have failed (shouldn't!)
{
- g = new char[bytes_written + 3];
+ g = (char *)malloc ( sizeof (char) * (bytes_written + 3));
char const *BOM = "\xFE\xFF";
strcpy (g, BOM);
memcpy (&g[2], g_without_BOM, bytes_written + 1); // Copy string + \0
- free (g_without_BOM);
+ g_free (g_without_BOM);
bytes_written += 2;
}
}