From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x22c.google.com (mail-wm0-x22c.google.com [IPv6:2a00:1450:400c:c09::22c]) (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 6BAE481D7C for ; Fri, 28 Oct 2016 03:45:03 -0700 (PDT) Received: by mail-wm0-x22c.google.com with SMTP id 79so12478360wmy.0 for ; Fri, 28 Oct 2016 03:45:03 -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=EgZS3yAsvdbzb7OAymXkgxtnehVG6xDA/F+9mebAons=; b=fEfZo+/rwqgC++r77I9waA6xmuSTRevvAJoQk1+onwxJRr02dKO5b/9Vi17ObRHVvP hhZtD3w+6s5g3BWy0f/3Xf+NHolTL7MPJ/aRj8tp5o1RltzrBOe1ZUCafB1FR87dLKE/ ErUBq2U9nl4bIHpiwNbxrWLGuNvLxAOr4ehu8= 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=EgZS3yAsvdbzb7OAymXkgxtnehVG6xDA/F+9mebAons=; b=Bytok04Stg1rlnSoBKGhQLJSaIV4VJZ21BvyHEEq/xKWjSgs3QXCw/IIoowijCx+6M +2FCNExcG0D0AWbmdE8WW990pioYkIgEzz9/z7GfkBuumSri2aH66usNpXXvSb/CVH2e V8FOb4vxG7v3e9d19FLnR4SpBUXotkHbiXyNZJcx91t7uIxUeoFOi7Vy/EeTT67PxbGv G1d2xvP/ZcqHum4jCLyj7eDDfqQ3MoRhi7YS7Sz6HcwTLKWEspCSLi16F15+y2iNznBA 9nHTe29lxvYe0955POZLKwBaGn6K81/661OnmJYIh/pxpxEFXQke8wmjsM4xJlw104Ij pTYA== X-Gm-Message-State: ABUngve/L4l8r+oblcPrCE3uHly8b/IVQ7DaTg6kMYIKoQZk2FRGdKmGsrmZnnwCfwc0YNlt X-Received: by 10.28.95.213 with SMTP id t204mr3165235wmb.18.1477651502285; Fri, 28 Oct 2016 03:45:02 -0700 (PDT) Received: from localhost.localdomain ([105.150.227.229]) by smtp.gmail.com with ESMTPSA id 184sm57730wms.4.2016.10.28.03.45.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 28 Oct 2016 03:45:01 -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 11:44:37 +0100 Message-Id: <1477651478-16830-9-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1477651478-16830-1-git-send-email-ard.biesheuvel@linaro.org> References: <1477651478-16830-1-git-send-email-ard.biesheuvel@linaro.org> Subject: [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 10:45:03 -0000 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 --- 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