public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] libebl: Don't update w, t and len unnecessarily in ebl_object_note_type_name.
@ 2018-11-15 14:55 Mark Wielaard
  2018-11-16  8:25 ` Mark Wielaard
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Wielaard @ 2018-11-15 14:55 UTC (permalink / raw)
  To: elfutils-devel; +Cc: Mark Wielaard

Harmless, but useless.

Signed-off-by: Mark Wielaard <mark@klomp.org>
---
 libebl/ChangeLog            | 5 +++++
 libebl/eblobjnotetypename.c | 8 +++-----
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/libebl/ChangeLog b/libebl/ChangeLog
index 79a2ff4..a2f8956 100644
--- a/libebl/ChangeLog
+++ b/libebl/ChangeLog
@@ -1,3 +1,8 @@
+2018-11-15  Mark Wielaard  <mark@klomp.org>
+
+	* eblobjnotetypename.c (ebl_object_note_type_name): Don't update
+	w, t and len unnecessarily.
+
 2018-11-12  Mark Wielaard  <mark@klomp.org>
 
 	* libebl.h (ebl_object_note): Add new argument namesz.
diff --git a/libebl/eblobjnotetypename.c b/libebl/eblobjnotetypename.c
index 29a5391..6b803ce 100644
--- a/libebl/eblobjnotetypename.c
+++ b/libebl/eblobjnotetypename.c
@@ -91,13 +91,11 @@ ebl_object_note_type_name (Ebl *ebl, const char *name, uint32_t type,
 	  t += w;
 	  len -= w;
 	  if (type == NT_GNU_BUILD_ATTRIBUTE_OPEN)
-	    w = snprintf (t, len, "OPEN");
+	    snprintf (t, len, "OPEN");
 	  else if (type == NT_GNU_BUILD_ATTRIBUTE_FUNC)
-	    w = snprintf (t, len, "FUNC");
+	    snprintf (t, len, "FUNC");
 	  else
-	    w = snprintf (t, len, "%x", type);
-	  t += w;
-	  len -= w;
+	    snprintf (t, len, "%x", type);
 
 	  return buf;
 	}
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] libebl: Don't update w, t and len unnecessarily in ebl_object_note_type_name.
  2018-11-15 14:55 [PATCH] libebl: Don't update w, t and len unnecessarily in ebl_object_note_type_name Mark Wielaard
@ 2018-11-16  8:25 ` Mark Wielaard
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Wielaard @ 2018-11-16  8:25 UTC (permalink / raw)
  To: elfutils-devel

On Thu, Nov 15, 2018 at 03:55:12PM +0100, Mark Wielaard wrote:
> Harmless, but useless.

Pushed to master.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-16  8:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-15 14:55 [PATCH] libebl: Don't update w, t and len unnecessarily in ebl_object_note_type_name Mark Wielaard
2018-11-16  8:25 ` 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).