patch-2.3.12 linux/lib/vsprintf.c

Next file: linux/mm/memory.c
Previous file: linux/kernel/sched.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.11/linux/lib/vsprintf.c linux/lib/vsprintf.c
@@ -156,7 +156,9 @@
 	int precision;		/* min. # of digits for integers; max
 				   number of chars for from string */
 	int qualifier;		/* 'h', 'l', or 'L' for integer fields */
+	                        /* 'z' support added 23/7/1999 S.H.    */
 
+	
 	for (str=buf ; *fmt ; ++fmt) {
 		if (*fmt != '%') {
 			*str++ = *fmt;
@@ -206,7 +208,7 @@
 
 		/* get the conversion qualifier */
 		qualifier = -1;
-		if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L') {
+		if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || *fmt =='z') {
 			qualifier = *fmt;
 			++fmt;
 		}
@@ -255,6 +257,9 @@
 			if (qualifier == 'l') {
 				long * ip = va_arg(args, long *);
 				*ip = (str - buf);
+			} else if (qualifier == 'z') {
+				size_t * ip = va_arg(args, size_t *);
+				*ip = (str - buf);
 			} else {
 				int * ip = va_arg(args, int *);
 				*ip = (str - buf);
@@ -292,6 +297,8 @@
 		}
 		if (qualifier == 'l')
 			num = va_arg(args, unsigned long);
+		else if (qualifier == 'z')
+			num = va_arg(args, size_t);
 		else if (qualifier == 'h') {
 			num = (unsigned short) va_arg(args, int);
 			if (flags & SIGN)

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