summaryrefslogtreecommitdiff
path: root/EmbeddedPkg/Universal/MmcDxe
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2016-10-24 18:33:31 +0100
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2016-10-28 15:54:00 +0100
commit4b335e4b7619eb12240de84cd256e5d0c3d6c84c (patch)
tree89a440749f7670e707b74a0e6f9e79a97f79b194 /EmbeddedPkg/Universal/MmcDxe
parente2dede1bc41acdc3e921144e12f471def562d45f (diff)
downloadedk2-platforms-4b335e4b7619eb12240de84cd256e5d0c3d6c84c.tar.xz
EmbeddedPkg/MmcDxe: eliminate deprecated string function calls
Get rid of calls to unsafe string functions. These are deprecated and may be removed in the future. Note that this also fixes an existing issue in the code, where the buffer may be overrun by one character when en == mLogRemainChar, in which case the NUL terminator ends up after the end of the buffer. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Diffstat (limited to 'EmbeddedPkg/Universal/MmcDxe')
-rw-r--r--EmbeddedPkg/Universal/MmcDxe/Diagnostics.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/EmbeddedPkg/Universal/MmcDxe/Diagnostics.c b/EmbeddedPkg/Universal/MmcDxe/Diagnostics.c
index 783e548d2a..7d6a5a0dde 100644
--- a/EmbeddedPkg/Universal/MmcDxe/Diagnostics.c
+++ b/EmbeddedPkg/Universal/MmcDxe/Diagnostics.c
@@ -42,9 +42,9 @@ DiagnosticLog (
)
{
UINTN len = StrLen (Str);
- if (len <= mLogRemainChar) {
+ if (len < mLogRemainChar) {
+ StrCpyS (mLogBuffer, mLogRemainChar, Str);
mLogRemainChar -= len;
- StrCpy (mLogBuffer, Str);
mLogBuffer += len;
return len;
} else {