qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Julio Faracco <jcfaracco@gmail.com>, qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Eduardo Habkost <ehabkost@redhat.com>,
	Richard Henderson <rth@twiddle.net>
Subject: Re: [PATCH v2] i386: Fix GCC warning with snprintf when HAX is enabled
Date: Sun, 1 Mar 2020 20:16:47 -0800	[thread overview]
Message-ID: <848ae3b4-18ec-958c-19e5-6d57d7641b14@linaro.org> (raw)
In-Reply-To: <20200301191708.18035-1-jcfaracco@gmail.com>

On 3/1/20 11:17 AM, Julio Faracco wrote:
> -    snprintf(name, sizeof HAX_VM_DEVFS, "/dev/hax_vm/vm%02d", vm_id);
> +    assert(vm_id < 0);
> +
> +    if (snprintf(name, sizeof HAX_VM_DEVFS, "/dev/hax_vm/vm%02d",
> +                 vm_id) < 0)
> +        return NULL;
> +

And the assert is opposite.  You didn't even smoke test.


r~


      parent reply	other threads:[~2020-03-02  4:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-01 19:17 [PATCH v2] i386: Fix GCC warning with snprintf when HAX is enabled Julio Faracco
2020-03-02  4:15 ` Richard Henderson
2020-03-02  4:16 ` Richard Henderson [this message]

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=848ae3b4-18ec-958c-19e5-6d57d7641b14@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=ehabkost@redhat.com \
    --cc=jcfaracco@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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 NNTP newsgroup(s).