This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC] Several sprintf removal, non-trivial


  As soon as the first argument of sprint is not a char array,
the removal of sprint function is not so obvious anymore...
  Here is a bunch of diffs to remove several of those
apparences.

  Comments most welcome,


Pierre Muller
as ARI maintainer.

PS: Note that I prefer to send the patch
as an attached file to avoid tab/space or LF/CRLF conversion problems...
I hope this is OK for everyone.


ChangeLog entry:

2012-11-21  Pierre Muller  <muller@sourceware.org>

        ARI fixes: sprintf rules.
        * elfread.c (elf_gnu_ifunc_resolve_by_got): Avoid use of sprintf
        by using a new local variable len.
        (build_id_to_debug_filename): Likewise, using new link_pos
        local variable.
        * infrun.c (xdb_handle_command): Aviod sprintf use using bufLen
        variable.
        * jv-exp.y (QualifiedName): Likewise re-using size used in
        malloc call previously.
        * linux-nat.c (linux_nat_detach): Use xsnprintf instead
        of sprintf.
        (linux_child_pid_to_exec_file): Likewise.
        (linux_proc_xfer_partial, linux_proc_pending_signals): Likewise.
        * mi/mi-main.c (get_register): Replace sprintf by xsnprintf.
        (mi_cmd_data_read_memory_bytes): Likewise.
        * mt-tdep.c (mt_register_name): Use xstrprintf instead of sprintf.
        * symtab.c (search_symbols): Use xsnprintf instead of sprintf.
        * tracepoint.c (stringify_collection_list): Likewise.
        * tui/tui-source.c (tui_set_source_content): Likewise.
        * utils.c (gdb_bfd_errmsg): Likewise.
        * valops.c (value_maybe_namespace_elt): Likewise.

Attachment: ARI-sprintf-non-obvious.patch
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]