All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jes Sorensen <Jes.Sorensen@redhat.com>
To: Sebastian Herbszt <herbszt@gmx.de>
Cc: seabios@seabios.org, QEMU Developers <qemu-devel@nongnu.org>
Subject: [Qemu-devel] Re: [SeaBIOS] SMBIOS strings
Date: Wed, 02 Jun 2010 08:44:42 +0200	[thread overview]
Message-ID: <4C05FDDA.7040107@redhat.com> (raw)
In-Reply-To: <915D11B7A1EA4FDC80761D20504E920B@FSCPC>

On 06/01/10 22:26, Sebastian Herbszt wrote:
> Jes Sorensen wrote:
>> Handle 0x0401, DMI type 4, 32 bytes
>> Processor Information
>> -       Socket Designation: CPU 1
>> +       Socket Designation: CPU01
> 
> smbios.c got
> snprintf((char*)start, 6, "CPU%2x", cpu_number);
> 
> It should print "CPU 1" instead of "CPU01" because the
> padding should be done with spaces not zeros. Maybe
> bvprintf() doesn't handle it correctly?

I looked at the man page for snprintf() and it isn't clear to me that it
is required to space pad when printing hex numbers.

Having looked at the other pieces, I think this is probably the only one
we might want to change. It should be pretty easy to just do something like:

if (cpu_number < 0x10)
	snprintf("CPU %x", cpu_number);
else
	snprintf("CPU%2x", cpu_number);

Esthetically I think this would be prettier, but question is whether
it's something to worry about or not.

Cheers,
Jes

  parent reply	other threads:[~2010-06-02  6:44 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-28 15:24 [Qemu-devel] SMBIOS strings Jes Sorensen
2010-05-28 15:44 ` [Qemu-devel] Re: [SeaBIOS] " Gleb Natapov
2010-05-31  7:32   ` Jes Sorensen
2010-05-31  7:50     ` Gleb Natapov
2010-05-31 20:38       ` Sebastian Herbszt
2010-06-01  5:34         ` Markus Armbruster
2010-06-01  6:05           ` Jes Sorensen
2010-06-01 23:57             ` [SeaBIOS] [Qemu-devel] " Kevin O'Connor
2010-06-01 13:02           ` Olivier Galibert
2010-06-01  5:36         ` [Qemu-devel] Re: [SeaBIOS] " Gleb Natapov
2010-05-29 12:49 ` Sebastian Herbszt
2010-05-31  7:33   ` Jes Sorensen
2010-05-29 16:15 ` Kevin O'Connor
2010-06-01 20:26 ` Sebastian Herbszt
2010-06-01 23:34   ` Kevin O'Connor
2010-06-02 20:35     ` Sebastian Herbszt
2010-06-02  6:44   ` Jes Sorensen [this message]
2010-06-02 21:01     ` Sebastian Herbszt

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=4C05FDDA.7040107@redhat.com \
    --to=jes.sorensen@redhat.com \
    --cc=herbszt@gmx.de \
    --cc=qemu-devel@nongnu.org \
    --cc=seabios@seabios.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.