From: Gleb Natapov <gleb@redhat.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] add "serial" parameter to -drive flag
Date: Tue, 23 Dec 2008 19:42:58 +0200 [thread overview]
Message-ID: <20081223174258.GB10805@redhat.com> (raw)
In-Reply-To: <f43fc5580812230920n57a619d5x74e9d7bde82ee665@mail.gmail.com>
On Tue, Dec 23, 2008 at 07:20:29PM +0200, Blue Swirl wrote:
> 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.
>
Ah. Will fix.
--
Gleb.
prev parent reply other threads:[~2008-12-23 17:42 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
2008-12-23 17:42 ` Gleb Natapov [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=20081223174258.GB10805@redhat.com \
--to=gleb@redhat.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).