qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] add "serial" parameter to -drive flag


From: Blue Swirl
Subject: Re: [Qemu-devel] [PATCH] add "serial" parameter to -drive flag
Date: Tue, 23 Dec 2008 19:20:29 +0200

On 12/23/08, Gleb Natapov <address@hidden> wrote:
> On Tue, Dec 23, 2008 at 06:06:07PM +0200, Blue Swirl wrote:
>  > On 12/23/08, Gleb Natapov <address@hidden> 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 <address@hidden>
>  >
>  > >  -    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 via email to

[Prev in Thread] Current Thread [Next in Thread]