From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-x236.google.com (mail-lf0-x236.google.com [IPv6:2a00:1450:4010:c07::236]) (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 880B91A1E91 for ; Mon, 24 Oct 2016 09:07:09 -0700 (PDT) Received: by mail-lf0-x236.google.com with SMTP id w206so2409946lff.7 for ; Mon, 24 Oct 2016 09:07:09 -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=GipwuQLuEBKYlkhEkKeoL6M2a0hoM+5fwmCrvKWUigs=; b=HLgIlsXftCQDgYC8kpdda8gMCkGfr46TZGw2MfDqT/kzfGQpE0DZ5gHvLGPYtbQhbI 3AyluT3mXHRz/tuqnTF2dvbA4k+iNYZbbYhfn4DzbNmxQYJ8bITnyya0Fhx5cM1hXjug WFRjIena2BMqbL2O5IQjPK9zG7E3fxKbSATKQ= 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=GipwuQLuEBKYlkhEkKeoL6M2a0hoM+5fwmCrvKWUigs=; b=FxKhESiVNIlBzWc+1XdyHhlBKgsqUBKXRE+xI920lYpLJFliLnW4MvUHLFZAnZPma+ ejCVQCTymLt1gH6BYxIIBRlAWGUmlFEJ7K/sXA/IS6TgzJBUco6OOw9XCe+jEy8AJJPw 4qyyI0WPD/mMg6wDfhiGeA9h6RkHbT6bW+x86M1X4UkhRYVZGoNBs9leSCbe9y3x/Te3 3Nsma8YJMU0uBdb958s5yGm4zOjH+g4iZYdie8iGCk3RQ+h06R1cLC0XvUW6dJ1jGoBD KQiq7anZ/hb5sDOol2/EoVfCLNqxL3H4OLekQwrhDMuU5Hqz0HS3xH9P3kGq7Unf6sUp y/Vg== X-Gm-Message-State: ABUngvdUv91zW5HqX2yFuvY1GZ+1MT/K3Vzy0Dti5mnynoj8gr0+RR1MfRZe39uRnvxLgYYE X-Received: by 10.194.111.229 with SMTP id il5mr11765091wjb.135.1477325226920; Mon, 24 Oct 2016 09:07:06 -0700 (PDT) Received: from localhost.localdomain ([105.146.229.54]) by smtp.gmail.com with ESMTPSA id h3sm20055144wjp.45.2016.10.24.09.07.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 24 Oct 2016 09:07:06 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org, leif.lindholm@linaro.org, lersek@redhat.com Cc: Ard Biesheuvel Date: Mon, 24 Oct 2016 17:06:45 +0100 Message-Id: <1477325206-24646-6-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1477325206-24646-1-git-send-email-ard.biesheuvel@linaro.org> References: <1477325206-24646-1-git-send-email-ard.biesheuvel@linaro.org> Subject: [PATCH 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: Mon, 24 Oct 2016 16:07:10 -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..351a8bd8edf4 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); + StrCpyS (Progress, sizeof (Progress), 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