BaseTools/EfiRom: Refine the logic in main()

This commit refines the logic for main(). It makes the logic more
straightforward to prevent possible mis-reports by static code
checkers.

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Hao Wu 2017-11-30 14:42:05 +08:00
parent 58356e9478
commit 31c295e71a
1 changed files with 7 additions and 5 deletions

View File

@ -101,11 +101,13 @@ Returns:
// Find the last . on the line and replace the filename extension with // Find the last . on the line and replace the filename extension with
// the default // the default
// //
for (Ext = mOptions.OutFileName + strlen (mOptions.OutFileName) - 1; Ext = mOptions.OutFileName + strlen (mOptions.OutFileName) - 1;
(Ext >= mOptions.OutFileName) && (*Ext != '.') && (*Ext != '\\'); while (Ext >= mOptions.OutFileName) {
Ext-- if ((*Ext == '.') || (*Ext == '\\')) {
) break;
; }
Ext--;
}
// //
// If dot here, then insert extension here, otherwise append // If dot here, then insert extension here, otherwise append
// //