From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x234.google.com (mail-wm0-x234.google.com [IPv6:2a00:1450:400c:c09::234]) (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 845191A1E8C for ; Wed, 26 Oct 2016 01:18:00 -0700 (PDT) Received: by mail-wm0-x234.google.com with SMTP id d128so71697107wmf.1 for ; Wed, 26 Oct 2016 01:18:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=K7Fg861LXuClSRGP7gJr8DHtQN6RvdPoz+5n3U3VwKA=; b=g8Hctj6Gl8HVBQCVeKHk+S2HWTvNlaopzIXUrk//uVjhGzerrFRe1muSKnkDAF/DNL LdhjcYmgD1qBWDYuMXZG6WoW5cD4bB2MU9VtEFBt2ch+OnhWCERp/mkmEKpR093jZ1JV fSQ7q7brIteWv7Yh05X65Dy42iUFp99kjWipw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=K7Fg861LXuClSRGP7gJr8DHtQN6RvdPoz+5n3U3VwKA=; b=VklIuyCZKAH3v3CUuch9SZDRUwd6ecnBG4ItlD3G7h2Jx9yAv920gHV67s7rH5SFbM kbnFjM2mJFUm+gWrhq5MWyZ13mwXqx22zTqm9Kd0D6CiSySyhwAveQwMX802QwWVhK9r oL7IfliRmsTDO+Ey+bhEBjNl+lvw5ooBFus85kZlLSZBPs3rHm+vpkHKxQ+wx5dM40MK p9bZ6tb61DDjaT+zkoXWkbhvo4RljeprGvKKg8hGzPySJqo6PCJyILcsX9SDcrWSxQiL Cu58IGHxB83LvQysRF933BKqqrm2tgtYvftGXYnqnmCxoVVaR6Z/p4aIH5/CBWDsk735 nsWg== X-Gm-Message-State: ABUngvcQhk+GGnUQ4CQ2lYMyusCO9ZaMqZWGCg6xCdXpVDF+Vuw3bu8lpDbZjitN1DTFExaV X-Received: by 10.194.104.40 with SMTP id gb8mr1036146wjb.28.1477469879178; Wed, 26 Oct 2016 01:17:59 -0700 (PDT) Received: from localhost.localdomain ([105.150.227.229]) by smtp.gmail.com with ESMTPSA id y2sm1166640wjx.20.2016.10.26.01.17.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 26 Oct 2016 01:17:58 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org, leif.lindholm@linaro.org Cc: lersek@redhat.com, ryan.harkin@linaro.org, Ard Biesheuvel Date: Wed, 26 Oct 2016 09:17:41 +0100 Message-Id: <1477469862-10046-6-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1477469862-10046-1-git-send-email-ard.biesheuvel@linaro.org> References: <1477469862-10046-1-git-send-email-ard.biesheuvel@linaro.org> Subject: [PATCH v2 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: Wed, 26 Oct 2016 08:18:00 -0000 Remove calls to deprecated string functions like AsciiStrCpy() and UnicodeStrToAsciiStr() Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel --- 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