patch-2.4.21 linux-2.4.21/lib/vsprintf.c

Next file: linux-2.4.21/mm/filemap.c
Previous file: linux-2.4.21/kernel/sysctl.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.20/lib/vsprintf.c linux-2.4.21/lib/vsprintf.c
@@ -637,7 +637,11 @@
 		while (isspace(*str))
 			str++;
 
-		if (!*str || !isdigit(*str))
+		if (!*str
+		    || (base == 16 && !isxdigit(*str))
+		    || (base == 10 && !isdigit(*str))
+		    || (base == 8 && (!isdigit(*str) || *str > '7'))
+		    || (base == 0 && !isdigit(*str)))
 			break;
 
 		switch(qualifier) {

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)