summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio
diff options
context:
space:
mode:
authormartynas <martynas@openbsd.org>2011-07-03 17:57:47 +0000
committermartynas <martynas@openbsd.org>2011-07-03 17:57:47 +0000
commite2114f6dde16fe54ebba3cc12c265ea2d83a227b (patch)
treefc2c1ac101f888db600dfbff82672a0c398ed0c4 /lib/libc/stdio
parentavoid void * pointer arithmetic (diff)
downloadwireguard-openbsd-e2114f6dde16fe54ebba3cc12c265ea2d83a227b.tar.xz
wireguard-openbsd-e2114f6dde16fe54ebba3cc12c265ea2d83a227b.zip
Recognize %a, %A format specifiers, per C99.
Diffstat (limited to 'lib/libc/stdio')
-rw-r--r--lib/libc/stdio/scanf.317
-rw-r--r--lib/libc/stdio/vfscanf.c12
2 files changed, 12 insertions, 17 deletions
diff --git a/lib/libc/stdio/scanf.3 b/lib/libc/stdio/scanf.3
index ecda103a926..716389407aa 100644
--- a/lib/libc/stdio/scanf.3
+++ b/lib/libc/stdio/scanf.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: scanf.3,v 1.17 2009/04/05 19:29:28 martynas Exp $
+.\" $OpenBSD: scanf.3,v 1.18 2011/07/03 17:57:47 martynas Exp $
.\"
.\" Copyright (c) 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -31,7 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd $Mdocdate: April 5 2009 $
+.Dd $Mdocdate: July 3 2011 $
.Dt SCANF 3
.Os
.Sh NAME
@@ -276,20 +276,17 @@ the next pointer must be a pointer to
.It Cm X
Equivalent to
.Cm x .
+.It Cm eE
+Equivalent to
+.Cm f .
.It Cm fF
Matches an optionally signed floating-point number;
the next pointer must be a pointer to
.Li float .
-.It Cm e
-Equivalent to
-.Cm f .
-.It Cm g
-Equivalent to
-.Cm f .
-.It Cm E
+.It Cm gG
Equivalent to
.Cm f .
-.It Cm G
+.It Cm aA
Equivalent to
.Cm f .
.It Cm s
diff --git a/lib/libc/stdio/vfscanf.c b/lib/libc/stdio/vfscanf.c
index ef682365224..16bbbbfc126 100644
--- a/lib/libc/stdio/vfscanf.c
+++ b/lib/libc/stdio/vfscanf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfscanf.c,v 1.26 2011/07/03 05:16:59 martynas Exp $ */
+/* $OpenBSD: vfscanf.c,v 1.27 2011/07/03 17:57:47 martynas Exp $ */
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
@@ -239,12 +239,10 @@ literal:
break;
#ifdef FLOATING_POINT
- case 'E':
- case 'G':
- case 'e':
- case 'f':
- case 'F':
- case 'g':
+ case 'e': case 'E':
+ case 'f': case 'F':
+ case 'g': case 'G':
+ case 'a': case 'A':
c = CT_FLOAT;
break;
#endif