summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2018-11-15 15:53:41 +0100
committerMark Wielaard <mark@klomp.org>2018-11-15 15:53:41 +0100
commitc338a0541663af13ede85732a472068ec74d9993 (patch)
tree8fff1a83dbd86e511b023e582bfca3ac70bfb149
parent422b549007f61f5577844d6e4590fdd2895fbee2 (diff)
libebl: Don't update w, t and len unnecessarily in ebl_object_note_type_name.
Harmless, but useless. Signed-off-by: Mark Wielaard <mark@klomp.org>
-rw-r--r--libebl/ChangeLog5
-rw-r--r--libebl/eblobjnotetypename.c8
2 files changed, 8 insertions, 5 deletions
diff --git a/libebl/ChangeLog b/libebl/ChangeLog
index 79a2ff4c..a2f89562 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 29a5391c..6b803cef 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;
}