Deleted Added
sdiff udiff text old ( 206622 ) new ( 208027 )
full compact
1.\" Copyright (c) 2000 The NetBSD Foundation, Inc.
2.\" All rights reserved.
3.\"
4.\" This file was contributed to The NetBSD Foundation by Allen Briggs.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:

--- 10 unchanged lines hidden (view full) ---

19.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25.\" POSSIBILITY OF SUCH DAMAGE.
26.\"
27.\" $FreeBSD: head/lib/libc/gen/fmtcheck.3 206622 2010-04-14 19:08:06Z uqs $
28.Dd October 16, 2002
29.Dt FMTCHECK 3
30.Os
31.Sh NAME
32.Nm fmtcheck
33.Nd sanitizes user-supplied
34.Xr printf 3 Ns -style
35format string

--- 46 unchanged lines hidden (view full) ---

82is a valid format and consumes the same argument types as
83.Fa fmt_default ,
84then the
85.Fn fmtcheck
86will return
87.Fa fmt_suspect .
88Otherwise, it will return
89.Fa fmt_default .
90.Sh SECURITY CONSIDERATIONS
91Note that the formats may be quite different as long as they accept the
92same arguments.
93For example,
94.Qq Li "%p %o %30s %#llx %-10.*e %n"
95is compatible with
96.Qq Li "This number %lu %d%% and string %s has %qd numbers and %.*g floats (%n)" .
97However,
98.Qq Li %o
99is not equivalent to
100.Qq Li %lx
101because
102the first requires an integer and the second requires a long.
103.Sh SEE ALSO
104.Xr printf 3
105.Sh BUGS
106The
107.Fn fmtcheck
108function does not recognize positional parameters.