]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools/C/Common: Fix parameter format mismatch in scanf functions
authorHao Wu <hao.a.wu@intel.com>
Thu, 22 Sep 2016 01:57:20 +0000 (09:57 +0800)
committerHao Wu <hao.a.wu@intel.com>
Tue, 8 Nov 2016 08:36:51 +0000 (16:36 +0800)
According to MSDN https://msdn.microsoft.com/en-us/library/6ttkkkhh.aspx

Format specification '%x' for scanf expects type 'int *', modify the type
of the relating variable to 'int' to keep them matched.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
BaseTools/Source/C/Common/ParseInf.c
BaseTools/Source/C/Common/SimpleFileParsing.c

index 0a204c865f4b28bae4ad360d8dd1dc7d470fce6b..d7845366d499fc82bb3503c9548e7f503d7defb1 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 This contains some useful functions for parsing INF files.\r
 \r
-Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -391,10 +391,10 @@ Returns:
 --*/\r
 {\r
   INT32 Index;\r
-  unsigned Data1;\r
-  unsigned Data2;\r
-  unsigned Data3;\r
-  unsigned Data4[8];\r
+  int   Data1;\r
+  int   Data2;\r
+  int   Data3;\r
+  int   Data4[8];\r
 \r
   if (AsciiGuidBuffer == NULL || GuidBuffer == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
index 877bb6fd5130dbe85b373503f0e4bd5d0007d9ab..868c6b794b99fa240a31e884131671b0e1b16f33 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 Generic but simple file parsing routines.\r
 \r
-Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -530,7 +530,7 @@ Returns:
 \r
 --*/\r
 {\r
-  unsigned Val;\r
+  int Val;\r
 \r
   SkipWhiteSpace (&mGlobals.SourceFile);\r
   if (EndOfFile (&mGlobals.SourceFile)) {\r
@@ -1276,7 +1276,7 @@ Returns:
 \r
 --*/\r
 {\r
-  unsigned      Value32;\r
+  INT32         Value32;\r
   UINT32        Index;\r
   FILE_POSITION FPos;\r
   CHAR8         TempString[20];\r