From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (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 67BA381D2D for ; Fri, 28 Oct 2016 03:53:42 -0700 (PDT) Received: by mail-wm0-x22d.google.com with SMTP id p190so1269194wmp.1 for ; Fri, 28 Oct 2016 03:53:42 -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=/rp/epedeog9HGpU5GyGVmQzx9DNVwoDFm8VbKLP98w=; b=N9zF1wuCB0Hc66or7tugJyCRoOuHPDVtOOKBBCrfoNsgDPXvW8O73ptBSxdZHYuhav n/Ge7zk8dwpJIrLfJCIfnkp7DZYZnefmiCZnBhIItYE/MA1BfjYudfxErgVc1A5sKUga kiDOVa1Y1Jws31f1wa9KUHTx+mC7qW2esRjb8= 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=/rp/epedeog9HGpU5GyGVmQzx9DNVwoDFm8VbKLP98w=; b=SJ68rL1vTAMBVd5JBnill8rbWoNtF/JUI5DuKqiT1YffoQa0TVr4fCFc1AJ81ahCJ3 riRSQ4X8kwOSZiaW5PijStCgXilHSZK/E2P+1txMg57br+qCi5HYtDMe3t2lIkUXyMNG P8yN7kJZ6RrLfT2InvxIMIpF8g4JrbMQ2u78ivcGVrnTje7jot8k6GeunVAsBRw21U/T kcu0uz8caRvuT3+1QyNzrpkTEanVH8D2keoRviyPIZbXHYVmSvVMIc5OwOzh887OWxNj VUqDT+YvSafE8iDfZ4RmtkWw/eNtk0vIySu4kLQOg+YBfZfKpfnoLpFHBxLyGJbx9WIz zmWg== X-Gm-Message-State: ABUngveI0JiHaXNjCM2WcbJruLn/JM5XlyKTqo4PFTZMfstB3M2Z2toXm137ExSoOg/uYUn7 X-Received: by 10.28.21.68 with SMTP id 65mr2306047wmv.132.1477652021486; Fri, 28 Oct 2016 03:53:41 -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 j189sm8234218wmd.22.2016.10.28.03.53.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Oct 2016 03:53:41 -0700 (PDT) Date: Fri, 28 Oct 2016 11:53:39 +0100 From: Leif Lindholm To: Ard Biesheuvel Cc: edk2-devel@lists.01.org, lersek@redhat.com, ryan.harkin@linaro.org Message-ID: <20161028105339.GF1161@bivouac.eciton.net> References: <1477646896-21444-1-git-send-email-ard.biesheuvel@linaro.org> <1477646896-21444-6-git-send-email-ard.biesheuvel@linaro.org> MIME-Version: 1.0 In-Reply-To: <1477646896-21444-6-git-send-email-ard.biesheuvel@linaro.org> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [PATCH v3 5/6] ArmPkg/BdsLib: eliminate calls to deprecated string functions 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 10:53:42 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Oct 28, 2016 at 10:28:15AM +0100, Ard Biesheuvel wrote: > Remove calls to deprecated string functions like AsciiStrCpy() and > UnicodeStrToAsciiStr() > > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Ard Biesheuvel > Reviewed-by: Laszlo Ersek > Tested-by: Ryan Harkin Reviewed-by: Leif Lindholm > --- > ArmPkg/Library/BdsLib/BdsFilePath.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/ArmPkg/Library/BdsLib/BdsFilePath.c b/ArmPkg/Library/BdsLib/BdsFilePath.c > index aefeaed4ffb5..f9d8c4c205bf 100644 > --- a/ArmPkg/Library/BdsLib/BdsFilePath.c > +++ b/ArmPkg/Library/BdsLib/BdsFilePath.c > @@ -964,7 +964,7 @@ Mtftp4CheckPacket ( > Step = (Context->DownloadedNbOfBytes * TFTP_PROGRESS_SLIDER_STEPS) / Context->FileSize; > if (Step > LastStep) { > Print (mTftpProgressDelete); > - StrCpy (Progress, mTftpProgressFrame); > + CopyMem (Progress, mTftpProgressFrame, sizeof mTftpProgressFrame); > for (Index = 1; Index < Step; Index++) { > Progress[Index] = L'='; > } > @@ -1044,6 +1044,7 @@ BdsTftpLoadImage ( > UINT64 FileSize; > UINT64 TftpBufferSize; > BDS_TFTP_CONTEXT *TftpContext; > + UINTN PathNameLen; > > ASSERT(IS_DEVICE_PATH_NODE (RemainingDevicePath, MESSAGING_DEVICE_PATH, MSG_IPv4_DP)); > IPv4DevicePathNode = (IPv4_DEVICE_PATH*)RemainingDevicePath; > @@ -1187,8 +1188,9 @@ BdsTftpLoadImage ( > > // The Device Path might contain multiple FilePath nodes > PathName = ConvertDevicePathToText ((EFI_DEVICE_PATH_PROTOCOL*)(IPv4DevicePathNode + 1), FALSE, FALSE); > - AsciiFilePath = AllocatePool (StrLen (PathName) + 1); > - UnicodeStrToAsciiStr (PathName, AsciiFilePath); > + PathNameLen = StrLen (PathName) + 1; > + AsciiFilePath = AllocatePool (PathNameLen); > + UnicodeStrToAsciiStrS (PathName, AsciiFilePath, PathNameLen); > > // > // Try to get the size of the file in bytes from the server. If it fails, > -- > 2.7.4 >