current_subfile = subfile;
/* Save its name and compilation directory name */
- subfile->name = (name == NULL)? NULL : strdup (name);
- subfile->dirname = (dirname == NULL) ? NULL : strdup (dirname);
+ subfile->name = (name == NULL) ? NULL : savestring (name, strlen (name));
+ subfile->dirname =
+ (dirname == NULL) ? NULL : savestring (dirname, strlen (dirname));
/* Initialize line-number recording for this subfile. */
subfile->line_vector = NULL;
&& subfile->name[strlen(subfile->name)-1] == '/')
{
subfile->dirname = subfile->name;
- subfile->name = strdup (name);
+ subfile->name = savestring (name, strlen (name));
/* Default the source language to whatever can be deduced from
the filename. If nothing can be deduced (such as for a C/C++
{
free (current_demangling_style_string);
current_demangling_style_string =
- strdup (dem -> demangling_style_name);
+ savestring (dem -> demangling_style_name,
+ strlen (dem -> demangling_style_name));
}
}
if (current_demangling_style == unknown_demangling)
one as the default. */
current_demangling_style = demanglers[0].demangling_style;
current_demangling_style_string =
- strdup (demanglers[0].demangling_style_name);
+ savestring (demanglers[0].demangling_style_name,
+ strlen (demanglers[0].demangling_style_name));
warning ("`%s' style demangling chosen as the default.\n",
current_demangling_style_string);
}
{
free (current_demangling_style_string);
}
- current_demangling_style_string = strdup (style);
+ current_demangling_style_string = savestring (style, strlen (style));
set_demangling_command ((char *) NULL, 0);
}