[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [SeaBIOS] SMBIOS strings
From: |
Jes Sorensen |
Subject: |
[Qemu-devel] Re: [SeaBIOS] SMBIOS strings |
Date: |
Wed, 02 Jun 2010 08:44:42 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-2.fc12 Lightning/1.0b2pre Thunderbird/3.0.4 |
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