Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[PATCH] %t... in vsnprintf

handling of %t... (ptrdiff_t) in vsnprintf

Signed-off-by: Al Viro <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Al Viro and committed by
Linus Torvalds
80322306 acd3bd82

+4 -1
+4 -1
lib/vsprintf.c
··· 269 269 int qualifier; /* 'h', 'l', or 'L' for integer fields */ 270 270 /* 'z' support added 23/7/1999 S.H. */ 271 271 /* 'z' changed to 'Z' --davidm 1/25/99 */ 272 + /* 't' added for ptrdiff_t */ 272 273 273 274 /* Reject out-of-range values early */ 274 275 if (unlikely((int) size < 0)) { ··· 340 339 /* get the conversion qualifier */ 341 340 qualifier = -1; 342 341 if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || 343 - *fmt =='Z' || *fmt == 'z') { 342 + *fmt =='Z' || *fmt == 'z' || *fmt == 't') { 344 343 qualifier = *fmt; 345 344 ++fmt; 346 345 if (qualifier == 'l' && *fmt == 'l') { ··· 468 467 num = (signed long) num; 469 468 } else if (qualifier == 'Z' || qualifier == 'z') { 470 469 num = va_arg(args, size_t); 470 + } else if (qualifier == 't') { 471 + num = va_arg(args, ptrdiff_t); 471 472 } else if (qualifier == 'h') { 472 473 num = (unsigned short) va_arg(args, int); 473 474 if (flags & SIGN)