void
coverage_init (const char *filename)
{
+ const char *original_filename = filename;
+ int original_len = strlen (original_filename);
#if HAVE_DOS_BASED_FILE_SYSTEM
const char *separator = "\\";
#else
bbg_file_name = xstrdup (profile_note_location);
else
{
- bbg_file_name = XNEWVEC (char, len + strlen (GCOV_NOTE_SUFFIX) + 1);
- memcpy (bbg_file_name, filename, len);
- strcpy (bbg_file_name + len, GCOV_NOTE_SUFFIX);
+ bbg_file_name = XNEWVEC (char, original_len + strlen (GCOV_NOTE_SUFFIX) + 1);
+ memcpy (bbg_file_name, original_filename, original_len);
+ strcpy (bbg_file_name + original_len, GCOV_NOTE_SUFFIX);
}
if (!gcov_open (bbg_file_name, -1))