Fix compile time warning from Clang about error messages not being printed safely.
authorNick Clifton <nickc@redhat.com>
Mon, 22 Aug 2022 15:19:17 +0000 (16:19 +0100)
committerNick Clifton <nickc@redhat.com>
Mon, 22 Aug 2022 15:19:17 +0000 (16:19 +0100)
binutils/readelf.c

index b6301660b7583cd18fb6cfcf9b32e1ea4326cb74..cafba9a4f565b65b481e1e6cd7466b20783f39c2 100644 (file)
@@ -5735,9 +5735,9 @@ check_magic_number (Filedata * filedata, Elf_Internal_Ehdr * header)
             so we provide two different kinds of error message.  */
          if (filedata->archive_file_size > 0
              && known_magic[i].ar_message != NULL)
-           error (known_magic[i].ar_message);
+           error ("%s", known_magic[i].ar_message);
          else
-           error (known_magic[i].obj_message);
+           error ("%s", known_magic[i].obj_message);
          return false;
        }
     }