From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=46488 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OJhh5-00060O-Ky for qemu-devel@nongnu.org; Wed, 02 Jun 2010 02:44:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OJhh4-0006jU-Ja for qemu-devel@nongnu.org; Wed, 02 Jun 2010 02:44:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:9098) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OJhh4-0006jE-BP for qemu-devel@nongnu.org; Wed, 02 Jun 2010 02:44:50 -0400 Message-ID: <4C05FDDA.7040107@redhat.com> Date: Wed, 02 Jun 2010 08:44:42 +0200 From: Jes Sorensen MIME-Version: 1.0 References: <4BFFE03F.40606@redhat.com> <915D11B7A1EA4FDC80761D20504E920B@FSCPC> In-Reply-To: <915D11B7A1EA4FDC80761D20504E920B@FSCPC> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [SeaBIOS] SMBIOS strings List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sebastian Herbszt Cc: seabios@seabios.org, QEMU Developers 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