about summary refs log tree commit diff
path: root/stdio-common/vfscanf.c
diff options
context:
space:
mode:
Diffstat (limited to 'stdio-common/vfscanf.c')
-rw-r--r--stdio-common/vfscanf.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/stdio-common/vfscanf.c b/stdio-common/vfscanf.c
index 4780f51021..3738e44f0a 100644
--- a/stdio-common/vfscanf.c
+++ b/stdio-common/vfscanf.c
@@ -925,24 +925,24 @@ __vfscanf (FILE *s, const char *format, va_list argptr)
 	  else
 	    negative = 0;
 
-	  if (c == '0' && tolower (c == inchar ()) == 'x')
+	  is_hexa = 0;
+	  exp_char = 'e';
+	  if (c == '0')
 	    {
-	      /* It is a number in hexadecimal format.  */
-	      ADDW ('0');
-	      ADDW ('x');
+	      ADDW (c);
+	      c = inchar ();
+	      if (tolower (c) == 'x')
+		{
+		  /* It is a number in hexadecimal format.  */
+		  ADDW (c);
 
-	      is_hexa = 1;
-	      exp_char = 'p';
+		  is_hexa = 1;
+		  exp_char = 'p';
 
-	      /* Grouping is not allowed.  */
-	      flags &= ~GROUP;
-	      c = inchar ();
-	    }
-	  else
-	    {
-	      /* It not a hexadecimal prefix.  */
-	      is_hexa = 0;
-	      exp_char = 'e';
+		  /* Grouping is not allowed.  */
+		  flags &= ~GROUP;
+		  c = inchar ();
+		}
 	    }
 
 	  got_dot = got_e = 0;