public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Ulf Hermann <ulf.hermann@qt.io>
To: <elfutils-devel@sourceware.org>
Subject: [PATCH] Fix nesting of braces
Date: Thu, 27 Apr 2017 16:02:00 -0000	[thread overview]
Message-ID: <e7ca4cd9-9efe-2744-8a16-e142074ae368@qt.io> (raw)

The way it was before it didn't actually test if elf_update failed, but
rather did something random. !!(<some number>) is a boolean and boolean
true can be represented as anything non-0, including negative numbers.

Signed-off-by: Ulf Hermann <ulf.hermann@qt.io>
---
  libasm/ChangeLog | 4 ++++
  libasm/asm_end.c | 2 +-
  2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/libasm/ChangeLog b/libasm/ChangeLog
index 1656842..d2bc408 100644
--- a/libasm/ChangeLog
+++ b/libasm/ChangeLog
@@ -1,3 +1,7 @@
+2017-04-27  Ulf Hermann  <ulf.hermann@qt.io>
+
+	* asm_end.c (binary_end): Fix nesting of braces.
+
  2017-02-12  Mark Wielaard  <mjw@redhat.com>
   	* asm_newsym.c (asm_newsym): Increase TEMPSYMLEN to 13.
diff --git a/libasm/asm_end.c b/libasm/asm_end.c
index 191a535..ced24f5 100644
--- a/libasm/asm_end.c
+++ b/libasm/asm_end.c
@@ -464,7 +464,7 @@ binary_end (AsmCtx_t *ctx)
    gelf_update_ehdr (ctx->out.elf, ehdr);
     /* Write out the ELF file.  */
-  if (unlikely (elf_update (ctx->out.elf, ELF_C_WRITE_MMAP)) < 0)
+  if (unlikely (elf_update (ctx->out.elf, ELF_C_WRITE_MMAP) < 0))
      {
        __libasm_seterrno (ASM_E_LIBELF);
        result = -1;
-- 
2.8.1.windows.1

             reply	other threads:[~2017-04-27 14:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-27 16:02 Ulf Hermann [this message]
2017-04-28  8:51 ` Mark Wielaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e7ca4cd9-9efe-2744-8a16-e142074ae368@qt.io \
    --to=ulf.hermann@qt.io \
    --cc=elfutils-devel@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).