Commit Graph

10 Commits

Author SHA1 Message Date
Xin LI
eb4bd20c17 Use const instead of __const, and merge the license change from NetBSD.
Obtained from:	NetBSD
2009-06-23 23:52:12 +00:00
David Schultz
cc4c35b961 Teach fmtcheck() about wint_t, intmax_t, char *, intmax_t *, and
wide string arguments.

Also simplify the code that handles length modifiers and make it
more conservative. For instance, be explicit about the modifiers
allowed for %d, rather than assuming that anything other than L,
q, t, or z implies an int argument.
2008-08-02 06:02:42 +00:00
David Schultz
3edb8f412f Teach fmtcheck() about the ' (thousands separator) flag. 2005-03-21 08:00:55 +00:00
David Schultz
38d17374b2 When *printf() and *scanf() are compiled without floating-point
support, fmtcheck() should not accept format strings that contain
floating-point formats.
2004-05-02 10:55:05 +00:00
David Schultz
ec045e41d9 Teach fmtcheck(3) about the flags a, A, F, G, t, and z. 2003-06-29 01:11:31 +00:00
Daniel Eischen
53154da089 Remove improper use of <namespace.h>.
Remove fmtcheck from application name space (fix the weak reference).
2002-06-27 13:20:54 +00:00
David E. O'Brien
ea8d448a92 Fix SCM ID's. 2002-02-01 00:57:29 +00:00
Ruslan Ermilov
8af1452cf8 Removed duplicate VCS ID tags, as per style(9). 2001-08-13 14:06:34 +00:00
Kris Kennaway
54b8fe08cf Remove unnecessary #include <stdlib.h>
Obtained from:	NetBSD
MFC After:	1 week
2001-07-16 04:48:28 +00:00
Kris Kennaway
3d09054934 Add fmtcheck(), a function for checking consistency of format string
arguments where the format string is obtained from user data, or
otherwise difficult to verify statically.

Example usage:

printf(fmtcheck(user_format, standard_format), arg1, arg2);

checks the format string user_format for consistency (same number/order/
type of format operators) with standard_format.  If they differ,
standard_format is used instead to avoid potential crashes or security
violations.

Obtained from:  NetBSD
Reviewed by:    -arch
2001-04-17 07:59:52 +00:00