From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6373481D88 for ; Fri, 28 Oct 2016 06:40:17 -0700 (PDT) Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 722DF61BA5; Fri, 28 Oct 2016 13:40:17 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-38.phx2.redhat.com [10.3.116.38]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9SDeFW6005138; Fri, 28 Oct 2016 09:40:16 -0400 To: Ard Biesheuvel , edk2-devel@ml01.01.org, leif.lindholm@linaro.org References: <1477651478-16830-1-git-send-email-ard.biesheuvel@linaro.org> <1477651478-16830-9-git-send-email-ard.biesheuvel@linaro.org> Cc: ryan.harkin@linaro.org From: Laszlo Ersek Message-ID: <671844d9-fba1-ff52-ac49-fcc1c509cec7@redhat.com> Date: Fri, 28 Oct 2016 15:40:15 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1477651478-16830-9-git-send-email-ard.biesheuvel@linaro.org> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 28 Oct 2016 13:40:17 +0000 (UTC) Subject: Re: [PATCH v2 8/9] EmbeddedPkg/MmcDxe: eliminate deprecated string function calls X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Oct 2016 13:40:17 -0000 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 10/28/16 12:44, Ard Biesheuvel wrote: > Get rid of calls to unsafe string functions. These are deprecated and may > be removed in the future. > > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Ard Biesheuvel > --- > EmbeddedPkg/Universal/MmcDxe/Diagnostics.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/EmbeddedPkg/Universal/MmcDxe/Diagnostics.c b/EmbeddedPkg/Universal/MmcDxe/Diagnostics.c > index 783e548d2aed..7d6a5a0dde01 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 { > Reviewed-by: Laszlo Ersek