From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x232.google.com (mail-wm0-x232.google.com [IPv6:2a00:1450:400c:c09::232]) (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 203A581D20 for ; Fri, 28 Oct 2016 02:28:34 -0700 (PDT) Received: by mail-wm0-x232.google.com with SMTP id n67so100872732wme.1 for ; Fri, 28 Oct 2016 02:28:34 -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=mLQTSzejhIlNUITTQtsXI6QYcbwj+vbwvG3e10pX424=; b=bhRw+Ij9vW+xxaAspLbciroN6NrF0h694H9uj7s2NPRbBDIodPWBKpq0+UDopicz6x 6uCQ64BIUW6OJsyk6aKqqZ6u6c8pZMteIVH4k2yJUTNdfzZzGVK6+DtVrD5kgEwkKj4F FnkZ3Zz/8yLuI2MFUbWl4fto16RWh3Il2vlWU= 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=mLQTSzejhIlNUITTQtsXI6QYcbwj+vbwvG3e10pX424=; b=Y0RQLkd73HU1oSen87D1wiLc+bFV+AW48Ja3slSDWohIfxp9hfy3kQIAyEpqsw/dqJ xq6qC3KctKg2xSGT8MTaHTMDCD0D0niBQUU4zDuNZXOaTZdW6E323H6qd40Ws8Gu4Dlm ioeHIAlUUOgxhhfiWN63trPBsxiRRP37cO7I4nqgu6415i/qlYwUFr2suqKSQ4wOIZZj T2bR9cufW8PnfpHAtywPabcTnqNKRWK9uhcAisOvWXsk63ivfvfg5smLFPR8E+VKAaH2 cjbOdMb9sFA4HR2CHRo5iW8GnUV7yahvr5JbX18ey4GH6zXmSk8Y7sqSi1mlYIg+AjQx zK1A== X-Gm-Message-State: ABUngvduyAWP8HkvP3s/YpfwnRRPGRjnwbb4Xos4tH8I5xkVPs2jrufgwPxE9EyobO7772Ea X-Received: by 10.28.9.195 with SMTP id 186mr2896595wmj.117.1477646913184; Fri, 28 Oct 2016 02:28:33 -0700 (PDT) Received: from localhost.localdomain ([105.150.227.229]) by smtp.gmail.com with ESMTPSA id t129sm5074228wmg.23.2016.10.28.02.28.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 28 Oct 2016 02:28:32 -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: Fri, 28 Oct 2016 10:28:15 +0100 Message-Id: <1477646896-21444-6-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1477646896-21444-1-git-send-email-ard.biesheuvel@linaro.org> References: <1477646896-21444-1-git-send-email-ard.biesheuvel@linaro.org> Subject: [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 09:28:34 -0000 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 --- 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