From af03df86f76a494dfa69aefcb7cfb8dfdcdf2a26 Mon Sep 17 00:00:00 2001 From: jljusten Date: Mon, 4 Jan 2010 16:17:52 +0000 Subject: [PATCH] IntelFrameworkModulePkg: SerialStatusCode output was incorrect The string being built had a character being overwritten. This also lead to a NULL character being sent out to the serial port for the last character in the string. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9669 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Universal/StatusCode/Pei/SerialStatusCodeWorker.c | 6 +++--- .../StatusCode/RuntimeDxe/SerialStatusCodeWorker.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/IntelFrameworkModulePkg/Universal/StatusCode/Pei/SerialStatusCodeWorker.c b/IntelFrameworkModulePkg/Universal/StatusCode/Pei/SerialStatusCodeWorker.c index 1b409310cf..c3cac2b6ac 100644 --- a/IntelFrameworkModulePkg/Universal/StatusCode/Pei/SerialStatusCodeWorker.c +++ b/IntelFrameworkModulePkg/Universal/StatusCode/Pei/SerialStatusCodeWorker.c @@ -94,7 +94,7 @@ SerialStatusCodeReportWorker ( if (CallerId != NULL) { CharCount += AsciiSPrint ( - &Buffer[CharCount - 1], + &Buffer[CharCount], (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)), " %g", CallerId @@ -103,7 +103,7 @@ SerialStatusCodeReportWorker ( if (Data != NULL) { CharCount += AsciiSPrint ( - &Buffer[CharCount - 1], + &Buffer[CharCount], (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)), " %x", Data @@ -111,7 +111,7 @@ SerialStatusCodeReportWorker ( } CharCount += AsciiSPrint ( - &Buffer[CharCount - 1], + &Buffer[CharCount], (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)), "\n\r" ); diff --git a/IntelFrameworkModulePkg/Universal/StatusCode/RuntimeDxe/SerialStatusCodeWorker.c b/IntelFrameworkModulePkg/Universal/StatusCode/RuntimeDxe/SerialStatusCodeWorker.c index c4e9e3340b..3ebaaed6cd 100644 --- a/IntelFrameworkModulePkg/Universal/StatusCode/RuntimeDxe/SerialStatusCodeWorker.c +++ b/IntelFrameworkModulePkg/Universal/StatusCode/RuntimeDxe/SerialStatusCodeWorker.c @@ -92,7 +92,7 @@ SerialStatusCodeReportWorker ( if (CallerId != NULL) { CharCount += AsciiSPrint ( - &Buffer[CharCount - 1], + &Buffer[CharCount], (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)), " %g", CallerId @@ -101,7 +101,7 @@ SerialStatusCodeReportWorker ( if (Data != NULL) { CharCount += AsciiSPrint ( - &Buffer[CharCount - 1], + &Buffer[CharCount], (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)), " %x", Data @@ -109,7 +109,7 @@ SerialStatusCodeReportWorker ( } CharCount += AsciiSPrint ( - &Buffer[CharCount - 1], + &Buffer[CharCount], (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)), "\n\r" );