binutils sprintf optimisation
authorAlan Modra <amodra@gmail.com>
Thu, 3 Aug 2023 03:02:40 +0000 (12:32 +0930)
committerAlan Modra <amodra@gmail.com>
Thu, 3 Aug 2023 11:50:33 +0000 (21:20 +0930)
commitad923ded82d0ede5a2506a9fbd0f5a5a6728e1a6
tree60fc72cb334c014f1aed431154cf8f35d224135e
parent75747be51e6d11287e12c4504f2607d36a0edfd2
binutils sprintf optimisation

Avoid the use of sprintf with a "%s" format string, replacing with
strcpy or stpcpy.  Use sprintf return value rather than a later
strlen.  Don't use strcat where we can keep track of the end of a
string output buffer.

* dlltool.c (look_for_prog): memcpy prefix and strcpy prog_name.
* dllwrap.c (look_for_prog): Likewise.
* resrc.c (look_for_default): Likewise.  Add quotes with memmove
rather than allocating another buffer.
* size.c (size_number): Use sprintf return value.
* stabs.c (parse_stab_argtypes): Likewise.
* windmc.c (write_bin): Likewes, and use stpcpy.
* wrstabs.c: Similarly throughout.
binutils/dlltool.c
binutils/dllwrap.c
binutils/resrc.c
binutils/size.c
binutils/stabs.c
binutils/windmc.c
binutils/wrstabs.c