[RFC] Several sprintf removal, non-trivial
Pierre Muller
pierre.muller@ics-cnrs.unistra.fr
Tue Nov 20 23:32:00 GMT 2012
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ARI-sprintf-non-obvious.patch
Type: application/octet-stream
Size: 16139 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20121120/82b475fb/attachment.obj>
More information about the Gdb-patches
mailing list