This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[COMMITTED PATCH] avoid addition to string literal in readelf.c
- From: Roland McGrath <mcgrathr at google dot com>
- To: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Fri, 11 Oct 2013 10:11:41 -0700
- Subject: [COMMITTED PATCH] avoid addition to string literal in readelf.c
- Authentication-results: sourceware.org; auth=none
Committed as obvious enough, to trunk and 2.24 branch.
(I am not a C++ ninny, but I have always found &array[n]
the more natural thing to write than array + n.)
Thanks,
Roland
binutils/
2013-10-11 Roland McGrath <mcgrathr@google.com>
* readelf.c (print_dynamic_symbol): Use array subscript syntax
rather than addition syntax with string literal.
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -9319,7 +9319,7 @@ print_dynamic_symbol (bfd_vma si, unsigned long hn)
n = print_vma (si, DEC_5);
if (n < 5)
- fputs (" " + n, stdout);
+ fputs (&" "[n], stdout);
printf (" %3lu: ", hn);
print_vma (psym->st_value, LONG_HEX);
putchar (' ');