[bfd] Ensure unique printable names for bfd archs
[binutils-gdb.git] / opcodes / z80-dis.c
index b23e8e99fd8fcffc4e55e5ade070c3e5609ed699..0e7a312ff8987e148e28e9877789cc87f022454a 100644 (file)
@@ -1,5 +1,5 @@
 /* Print Z80, Z180, EZ80 and R800 instructions
-   Copyright (C) 2005-2020 Free Software Foundation, Inc.
+   Copyright (C) 2005-2021 Free Software Foundation, Inc.
    Contributed by Arnold Metselaar <arnold_m@operamail.com>
 
    This file is part of the GNU opcodes library.
@@ -414,7 +414,7 @@ dump (struct buffer *buf, disassemble_info * info, const char *txt)
 }
 
 /* Table to disassemble machine codes with prefix 0xED.  */
-struct tab_elt opc_ed[] =
+static const struct tab_elt opc_ed[] =
 {
   { 0x30, 0xFF, prt, "mul d,e", INSS_Z80N },
   { 0x31, 0xFF, prt, "add hl,a", INSS_Z80N },
@@ -525,7 +525,7 @@ static int
 pref_ed (struct buffer *buf, disassemble_info *info,
          const char *txt ATTRIBUTE_UNUSED)
 {
-  struct tab_elt *p;
+  const struct tab_elt *p;
 
   if (fetch_data (buf, info, 1))
     {
@@ -804,6 +804,7 @@ suffix (struct buffer *buf, disassemble_info *info, const char *txt)
   old_stream = info->stream;
   info->fprintf_func = (fprintf_ftype) &sprintf;
   info->stream = mybuf;
+  mybuf[0] = 0;
   buf->base++;
   if (print_insn_z80_buf (buf, info) >= 0)
     buf->n_used++;