patch-2.4.0-test2 linux/lib/vsprintf.c

Next file: linux/mm/mmap.c
Previous file: linux/lib/cmdline.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test1/linux/lib/vsprintf.c linux/lib/vsprintf.c
@@ -31,8 +31,8 @@
 			}
 		}
 	}
-	while (isxdigit(*cp) && (value = isdigit(*cp) ? *cp-'0' : (islower(*cp)
-	    ? toupper(*cp) : *cp)-'A'+10) < base) {
+	while (isxdigit(*cp) &&
+	       (value = isdigit(*cp) ? *cp-'0' : toupper(*cp)-'A'+10) < base) {
 		result = result*base + value;
 		cp++;
 	}
@@ -48,14 +48,11 @@
 	return simple_strtoul(cp,endp,base);
 }
 
-/* we use this so that we can do without the ctype library */
-#define is_digit(c)	((c) >= '0' && (c) <= '9')
-
 static int skip_atoi(const char **s)
 {
 	int i=0;
 
-	while (is_digit(**s))
+	while (isdigit(**s))
 		i = i*10 + *((*s)++) - '0';
 	return i;
 }
@@ -175,7 +172,7 @@
 		
 		/* get field width */
 		field_width = -1;
-		if (is_digit(*fmt))
+		if (isdigit(*fmt))
 			field_width = skip_atoi(&fmt);
 		else if (*fmt == '*') {
 			++fmt;
@@ -191,7 +188,7 @@
 		precision = -1;
 		if (*fmt == '.') {
 			++fmt;	
-			if (is_digit(*fmt))
+			if (isdigit(*fmt))
 				precision = skip_atoi(&fmt);
 			else if (*fmt == '*') {
 				++fmt;

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