[BACK]Return to fmtcheck.3 CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / lib / libc / gen

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/lib/libc/gen/fmtcheck.3 between version 1.1.2.1 and 1.8

version 1.1.2.1, 2002/03/08 21:35:04 version 1.8, 2014/06/14 08:18:24
Line 13 
Line 13 
 .\" 2. Redistributions in binary form must reproduce the above copyright  .\" 2. Redistributions in binary form must reproduce the above copyright
 .\"    notice, this list of conditions and the following disclaimer in the  .\"    notice, this list of conditions and the following disclaimer in the
 .\"    documentation and/or other materials provided with the distribution.  .\"    documentation and/or other materials provided with the distribution.
 .\" 3. All advertising materials mentioning features or use of this software  
 .\"    must display the following acknowledgement:  
 .\"        This product includes software developed by the NetBSD  
 .\"        Foundation, Inc. and its contributors.  
 .\" 4. Neither the name of The NetBSD Foundation nor the names of its  
 .\"    contributors may be used to endorse or promote products derived  
 .\"    from this software without specific prior written permission.  
 .\"  .\"
 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS  .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED  .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
Line 33 
Line 26 
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE  .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.  .\" POSSIBILITY OF SUCH DAMAGE.
 .\"  .\"
 .Dd October 17, 2000  .Dd June 14, 2014
 .Os  
 .Dt FMTCHECK 3  .Dt FMTCHECK 3
   .Os
 .Sh NAME  .Sh NAME
 .Nm fmtcheck  .Nm fmtcheck
 .Nd sanitizes user-supplied printf(3)-style format string  .Nd sanitizes user-supplied printf(3)-style format string
 .Sh LIBRARY  .Sh LIBRARY
 .Lb libc  .Lb libc
 .Sh SYNOPSIS  .Sh SYNOPSIS
 .Fd #include \*[Lt]stdio.h\*[Gt]  .In stdio.h
 .Ft const char *  .Ft const char *
 .Fn fmtcheck "const char *fmt_suspect" "const char *fmt_default"  .Fn fmtcheck "const char *fmt_suspect" "const char *fmt_default"
 .Sh DESCRIPTION  .Sh DESCRIPTION
Line 63  is a valid format string.
Line 56  is a valid format string.
 The  The
 .Xr printf 3  .Xr printf 3
 family of functions can not verify the types of arguments that they are  family of functions can not verify the types of arguments that they are
 passed at run-time.  In some cases, like  passed at run-time.
   In some cases, like
 .Xr catgets 3 ,  .Xr catgets 3 ,
 it is useful or necessary to use a user-supplied format string with no  it is useful or necessary to use a user-supplied format string with no
 guarantee that the format string matches the specified parameters.  guarantee that the format string matches the specified parameters.
Line 78  printf(fmtcheck(user_format, standard_fo
Line 72  printf(fmtcheck(user_format, standard_fo
 In the check, field widths, fillers, precisions, etc. are ignored (unless  In the check, field widths, fillers, precisions, etc. are ignored (unless
 the field width or precision is an asterisk  the field width or precision is an asterisk
 .Ql *  .Ql *
 instead of a digit string).  Also, any text other than the format specifiers  instead of a digit string).
 is completely ignored.  Also, any text other than the format specifiers is completely ignored.
 .Pp  .Pp
 Note that the formats may be quite different as long as they accept the  Note that the formats may be quite different as long as they accept the
 same parameters.  For example, ".Dq %p %o %30s %#llx %-10.*e %n" is  same parameters.
   For example, "%ld %o %30s %#llx %-10.*e %n" is
 compatible with "This number %lu %d%% and string %s has %qd numbers  compatible with "This number %lu %d%% and string %s has %qd numbers
 and %.*g floats (%n)."  However, "%o" is not equivalent to "%lx" because  and %.*g floats (%n)."
 the first requires an integer and the second requires a long.  However, "%o" is not equivalent to "%lx" because
   the first requires an integer and the second requires a long,
   and "%p" is not equivalent to "%lu" because
   the first requires a pointer and the second requires a long.
 .Sh RETURN VALUES  .Sh RETURN VALUES
 If  If
 .Fa fmt_suspect  .Fa fmt_suspect

Legend:
Removed from v.1.1.2.1  
changed lines
  Added in v.1.8

CVSweb <webmaster@jp.NetBSD.org>