From 52757f69e9a67c27c6a5f8188c3f281dc6ac35e8 Mon Sep 17 00:00:00 2001 From: Hao Wu Date: Mon, 6 Mar 2017 10:39:34 +0800 Subject: [PATCH] BaseTools/GenVtf: Fix VS2010/VS2012 build failure https://bugzilla.tianocore.org/show_bug.cgi?id=417 The commit makes the following refinements in GenVtf source codes to avoid VS2010/VS2012 build failure: 1. Refines coding style to declare local variables at the beginning of a code block in function 'main'. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu Reviewed-by: Yonghong Zhu --- BaseTools/Source/C/GenVtf/GenVtf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/BaseTools/Source/C/GenVtf/GenVtf.c b/BaseTools/Source/C/GenVtf/GenVtf.c index ff0e7cfb2c..2ae9a7be2c 100644 --- a/BaseTools/Source/C/GenVtf/GenVtf.c +++ b/BaseTools/Source/C/GenVtf/GenVtf.c @@ -2703,10 +2703,12 @@ Returns: } SymFileName = VTF_SYM_FILE; } else { - assert (OutFileName1); - INTN OutFileNameLen = strlen(OutFileName1); + INTN OutFileNameLen; INTN NewIndex; + assert (OutFileName1); + OutFileNameLen = strlen(OutFileName1); + for (NewIndex = OutFileNameLen; NewIndex > 0; --NewIndex) { if (OutFileName1[NewIndex] == '/' || OutFileName1[NewIndex] == '\\') { break; -- 2.39.2