Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/gen Teach fmtcheck(3) that a pointer and a long are...
details: https://anonhg.NetBSD.org/src/rev/95f61fdc14ee
branches: trunk
changeset: 329929:95f61fdc14ee
user: apb <apb%NetBSD.org@localhost>
date: Sat Jun 14 08:18:24 2014 +0000
description:
Teach fmtcheck(3) that a pointer and a long are not the same.
diffstat:
lib/libc/gen/fmtcheck.3 | 10 ++++++----
lib/libc/gen/fmtcheck.c | 7 ++++---
2 files changed, 10 insertions(+), 7 deletions(-)
diffs (69 lines):
diff -r 9933df574d2e -r 95f61fdc14ee lib/libc/gen/fmtcheck.3
--- a/lib/libc/gen/fmtcheck.3 Sat Jun 14 07:39:28 2014 +0000
+++ b/lib/libc/gen/fmtcheck.3 Sat Jun 14 08:18:24 2014 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: fmtcheck.3,v 1.7 2009/03/09 19:24:26 joerg Exp $
+.\" $NetBSD: fmtcheck.3,v 1.8 2014/06/14 08:18:24 apb Exp $
.\"
.\" Copyright (c) 2000 The NetBSD Foundation, Inc.
.\" All rights reserved.
@@ -26,7 +26,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd October 17, 2000
+.Dd June 14, 2014
.Dt FMTCHECK 3
.Os
.Sh NAME
@@ -77,11 +77,13 @@
.Pp
Note that the formats may be quite different as long as they accept the
same parameters.
-For example, "%p %o %30s %#llx %-10.*e %n" is
+For example, "%ld %o %30s %#llx %-10.*e %n" is
compatible with "This number %lu %d%% and string %s has %qd numbers
and %.*g floats (%n)."
However, "%o" is not equivalent to "%lx" because
-the first requires an integer and the second requires a long.
+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
If
.Fa fmt_suspect
diff -r 9933df574d2e -r 95f61fdc14ee lib/libc/gen/fmtcheck.c
--- a/lib/libc/gen/fmtcheck.c Sat Jun 14 07:39:28 2014 +0000
+++ b/lib/libc/gen/fmtcheck.c Sat Jun 14 08:18:24 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fmtcheck.c,v 1.8 2008/04/28 20:22:59 martin Exp $ */
+/* $NetBSD: fmtcheck.c,v 1.9 2014/06/14 08:18:24 apb Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fmtcheck.c,v 1.8 2008/04/28 20:22:59 martin Exp $");
+__RCSID("$NetBSD: fmtcheck.c,v 1.9 2014/06/14 08:18:24 apb Exp $");
#endif
#include "namespace.h"
@@ -49,6 +49,7 @@
FMTCHECK_INT,
FMTCHECK_LONG,
FMTCHECK_QUAD,
+ FMTCHECK_POINTER,
FMTCHECK_SHORTPOINTER,
FMTCHECK_INTPOINTER,
FMTCHECK_LONGPOINTER,
@@ -149,7 +150,7 @@
if (*f == 'p') {
if (sh + lg + quad + longdouble)
RETURN(pf,f,FMTCHECK_UNKNOWN);
- RETURN(pf,f,FMTCHECK_LONG);
+ RETURN(pf,f,FMTCHECK_POINTER);
}
RETURN(pf,f,FMTCHECK_UNKNOWN);
/*NOTREACHED*/
Home |
Main Index |
Thread Index |
Old Index