diff options
author | Alan Modra <amodra@gmail.com> | 2023-03-24 16:30:48 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2023-03-24 21:01:43 +1030 |
commit | 9c26a640c760f8b51a810f72e7dc58dd1d467cf4 (patch) | |
tree | 5ce571dd20fbcc1439f3e7cbba141b1107cb00ea | |
parent | 17749b3926dcf60acfec6b718733f3932b9fe880 (diff) | |
download | binutils-9c26a640c760f8b51a810f72e7dc58dd1d467cf4.zip binutils-9c26a640c760f8b51a810f72e7dc58dd1d467cf4.tar.gz binutils-9c26a640c760f8b51a810f72e7dc58dd1d467cf4.tar.bz2 |
Tidy string_ptr increment
* peicode.h (pe_ILF_make_a_symbol): Use sprintf output to
increment string_ptr to end of new string.
-rw-r--r-- | bfd/peicode.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bfd/peicode.h b/bfd/peicode.h index f1f3ce8..f16aeca 100644 --- a/bfd/peicode.h +++ b/bfd/peicode.h @@ -576,7 +576,7 @@ pe_ILF_make_a_symbol (pe_ILF_vars * vars, esym = vars->esym_ptr; /* Copy the symbol's name into the string table. */ - sprintf (vars->string_ptr, "%s%s", prefix, symbol_name); + int len = sprintf (vars->string_ptr, "%s%s", prefix, symbol_name); if (section == NULL) section = bfd_und_section_ptr; @@ -612,7 +612,7 @@ pe_ILF_make_a_symbol (pe_ILF_vars * vars, vars->table_ptr ++; vars->native_ptr ++; vars->esym_ptr ++; - vars->string_ptr += strlen (symbol_name) + strlen (prefix) + 1; + vars->string_ptr += len + 1; BFD_ASSERT (vars->string_ptr < vars->end_string_ptr); } |