mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 09:08:59 +00:00
ARI fixes: Avoid sprintf function use rule.
* charset.c (convert_between_encodings): Use xsnprintf. * cli-out.c (cli_field_int): Likewise. * cp-namespace.c (cp_lookup_nested_symbol): Likewise. * expprint.c (op_name_standard): Likewise. * frv-tdep.c (set_variant_num_gprs): Likewise. (set_variant_num_fprs): Likewise. * m68hc11-tdep.c (m68hc11_initialize_register_info): Likewise. * nto-tdep.c (nto_find_and_open_solib): Likewise. (nto_init_solib_absolute_prefix): Likewise. * source.c (init_source_path): Likewise. (print_source_lines_base): Likewise. * valprint.c (print_wchar): Likewise. * mi/mi-out.c (mi_field_int): Likewise. windows-nat.c (windows_pid_to_exec_file): Likewise. (windows_create_inferior): Likewise. (_initialize_check_for_gdb_ini): Likewise.
This commit is contained in:
@@ -688,6 +688,7 @@ cp_lookup_nested_symbol (struct type *parent_type,
|
||||
just like members of namespaces; in particular,
|
||||
lookup_symbol_namespace works when looking them up. */
|
||||
|
||||
int size;
|
||||
const char *parent_name = type_name_no_tag_or_error (saved_parent_type);
|
||||
struct symbol *sym
|
||||
= cp_lookup_symbol_in_namespace (parent_name, nested_name,
|
||||
@@ -703,9 +704,9 @@ cp_lookup_nested_symbol (struct type *parent_type,
|
||||
namespace seach is is already not C++ compliant and more
|
||||
assumptions could make it too magic. */
|
||||
|
||||
concatenated_name = alloca (strlen (parent_name) + 2
|
||||
+ strlen (nested_name) + 1);
|
||||
sprintf (concatenated_name, "%s::%s",
|
||||
size = strlen (parent_name) + 2 + strlen (nested_name) + 1;
|
||||
concatenated_name = alloca (size);
|
||||
xsnprintf (concatenated_name, size, "%s::%s",
|
||||
parent_name, nested_name);
|
||||
sym = lookup_static_symbol_aux (concatenated_name, VAR_DOMAIN);
|
||||
if (sym != NULL)
|
||||
|
||||
Reference in New Issue
Block a user