This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

[COMMITTED PATCH] avoid addition to string literal in readelf.c


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 (' ');


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