From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5766981DA7 for ; Fri, 28 Oct 2016 07:39:49 -0700 (PDT) Received: by mail-wm0-x22b.google.com with SMTP id p190so15251498wmp.1 for ; Fri, 28 Oct 2016 07:39:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ioohnVqaNqN59oWJcOpVW0wME2j/34XSVRrmAoz6YeM=; b=HtFZ0Oz1OBRbZkYLTn2+XXbFliFnIN706QpMShBYNIKWrTnUw/7RPjsLPm4FFacxSK qmsmwk+vieZpJ5Z+ex3UYnlGyWymxnXf85MFNbrWBw8X7JBHzmgF8/CaBJU0vH4rW8NR dpdhFe/SP6yTAuTtLMawSMhP5MEroe9rdqhaQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ioohnVqaNqN59oWJcOpVW0wME2j/34XSVRrmAoz6YeM=; b=J4ilrwTnK9Xzr+b270gGOkqnCN0n83MUakySnbKJsY6gVwTl8AIYWzJGzMbHF5+1fV GeuVhbKrVQ3wYrTKwne8zpfml+BxfRQkMjHnssOYx1PjjZKCKlNeiiRnYuRZ1MXmS6pj Dr/8VYPw4v9HvE5Fg/ln3jIaiHBSY8OJM8JLdpmJPSrZVgBwpj0ER2dvOcfQjbqFivf3 czPw5lQA0u7y6r14z8tp6PtRI4xDleA2qByL7/sQZt0Tf0vGokYI3v3x7gtBI8qdWuMU TgAOyNmvpitIXPsUQRXey+jRnzXtvXLU+wgSzuSnRYn+NS2rCgnsI4U4jxvHkCQqf6Gj sv+g== X-Gm-Message-State: ABUngvdB+HbLQ2778WHPCGijlQi28x0kPGd4jV+inie7lrPjUGiYdp6uKR8F5fu+Jq/2GlXo X-Received: by 10.28.215.6 with SMTP id o6mr2996617wmg.124.1477665588167; Fri, 28 Oct 2016 07:39:48 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id 18sm9231260wmp.24.2016.10.28.07.39.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Oct 2016 07:39:47 -0700 (PDT) Date: Fri, 28 Oct 2016 15:39:45 +0100 From: Leif Lindholm To: Ard Biesheuvel Cc: edk2-devel@lists.01.org, lersek@redhat.com, ryan.harkin@linaro.org Message-ID: <20161028143945.GR1161@bivouac.eciton.net> References: <1477651478-16830-1-git-send-email-ard.biesheuvel@linaro.org> <1477651478-16830-9-git-send-email-ard.biesheuvel@linaro.org> MIME-Version: 1.0 In-Reply-To: <1477651478-16830-9-git-send-email-ard.biesheuvel@linaro.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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 14:39:49 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Oct 28, 2016 at 11:44:37AM +0100, 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 Reviewed-by: Leif Lindholm (I also agree with Laszlo's comment regarding the commit message.) > --- > 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 { > -- > 2.7.4 >