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>
// Find the last . on the line and replace the filename extension with\r
// the default\r
//\r
- for (Ext = mOptions.OutFileName + strlen (mOptions.OutFileName) - 1;\r
- (Ext >= mOptions.OutFileName) && (*Ext != '.') && (*Ext != '\\');\r
- Ext--\r
- )\r
- ;\r
+ Ext = mOptions.OutFileName + strlen (mOptions.OutFileName) - 1;\r
+ while (Ext >= mOptions.OutFileName) {\r
+ if ((*Ext == '.') || (*Ext == '\\')) {\r
+ break;\r
+ }\r
+ Ext--;\r
+ }\r
//\r
// If dot here, then insert extension here, otherwise append\r
//\r