qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Blue Swirl" <blauwirbel@gmail.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] add "serial" parameter to -drive flag
Date: Tue, 23 Dec 2008 19:20:29 +0200	[thread overview]
Message-ID: <f43fc5580812230920n57a619d5x74e9d7bde82ee665@mail.gmail.com> (raw)
In-Reply-To: <20081223163806.GA10805@redhat.com>

On 12/23/08, Gleb Natapov <gleb@redhat.com> wrote:
> On Tue, Dec 23, 2008 at 06:06:07PM +0200, Blue Swirl wrote:
>  > On 12/23/08, Gleb Natapov <gleb@redhat.com> wrote:
>  > > Windows calculates HW "uniqueness" based on a hard drive serial number
>  > >  among other things. The patch allows to specify drive serial number
>  > >  from a command line.
>  > >
>  > >  Signed-off-by: Gleb Natapov <gleb@redhat.com>
>  >
>  > >  -    snprintf(buf, sizeof(buf), "QM%05d", s->drive_serial);
>  >
>  > >  -    snprintf(buf, sizeof(buf), "QM%05d", s->drive_serial);
>  >
>  > >  -    snprintf(buf, sizeof(buf), "QM%05d", s->drive_serial);
>  >
>  > >  +            sprintf(s->drive_serial_str, "QM%05d", s->drive_serial);
>  >
>  > You better watch out, this degrades snprintf to sprintf.
>  >
>
> I can use snprintf, but in this case we know exactly the length of the
>  resulting string.

True, but OpenBSD linker issues warnings when sprintf and friends are used.

  reply	other threads:[~2008-12-23 17:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-23 13:23 [Qemu-devel] [PATCH] add "serial" parameter to -drive flag Gleb Natapov
2008-12-23 16:06 ` Blue Swirl
2008-12-23 16:38   ` Gleb Natapov
2008-12-23 17:20     ` Blue Swirl [this message]
2008-12-23 17:42       ` Gleb Natapov

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=f43fc5580812230920n57a619d5x74e9d7bde82ee665@mail.gmail.com \
    --to=blauwirbel@gmail.com \
    --cc=qemu-devel@nongnu.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 NNTP newsgroup(s).