From: Hao Wu Date: Mon, 6 Mar 2017 02:39:34 +0000 (+0800) Subject: BaseTools/GenVtf: Fix VS2010/VS2012 build failure X-Git-Tag: edk2-stable201903~4464 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=52757f69e9a67c27c6a5f8188c3f281dc6ac35e8 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 --- 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;