* [PATCH 1/2] debugedit: strip extra newline characters from diagnostic messages
@ 2021-04-26 20:00 Dmitry V. Levin
2021-04-29 12:26 ` Mark Wielaard
0 siblings, 1 reply; 2+ messages in thread
From: Dmitry V. Levin @ 2021-04-26 20:00 UTC (permalink / raw)
To: debugedit
Since the output produced by error() is already terminated by a newline
character, no newline terminating characters are needed in diagnostic
messages printed using error().
* tools/debugedit.c (main): Remove terminating newline characters from
format strings passed to error().
---
tools/debugedit.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/debugedit.c b/tools/debugedit.c
index 4527a08..5d1644f 100644
--- a/tools/debugedit.c
+++ b/tools/debugedit.c
@@ -3538,7 +3538,7 @@ main (int argc, char *argv[])
GElf_Shdr shdr_mem;
GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
if (shdr == NULL)
- error (1, 0, "Couldn't get shdr: %s\n", elf_errmsg (-1));
+ error (1, 0, "Couldn't get shdr: %s", elf_errmsg (-1));
/* Any sections we have changed aren't allocated sections,
so we don't need to lookup any changed section sizes. */
@@ -3558,7 +3558,7 @@ main (int argc, char *argv[])
GElf_Shdr shdr_mem;
GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
if (shdr == NULL)
- error (1, 0, "Couldn't get shdr: %s\n", elf_errmsg (-1));
+ error (1, 0, "Couldn't get shdr: %s", elf_errmsg (-1));
/* A bug in elfutils before 0.169 means we have to write out
all section data, even when nothing changed.
@@ -3607,7 +3607,7 @@ main (int argc, char *argv[])
shdr->sh_size = sec_size;
shdr->sh_offset = sec_offset;
if (gelf_update_shdr (scn, shdr) == 0)
- error (1, 0, "Couldn't update shdr: %s\n",
+ error (1, 0, "Couldn't update shdr: %s",
elf_errmsg (-1));
}
}
@@ -3621,7 +3621,7 @@ main (int argc, char *argv[])
{
dso->ehdr.e_shoff = new_offset;
if (gelf_update_ehdr (elf, &dso->ehdr) == 0)
- error (1, 0, "Couldn't update ehdr: %s\n", elf_errmsg (-1));
+ error (1, 0, "Couldn't update ehdr: %s", elf_errmsg (-1));
}
}
--
ldv
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-04-29 12:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-26 20:00 [PATCH 1/2] debugedit: strip extra newline characters from diagnostic messages Dmitry V. Levin
2021-04-29 12:26 ` Mark Wielaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).