summaryrefslogtreecommitdiff
path: root/lib/libc/stdio
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>1997-11-23 06:02:47 +0000
committerBruce Evans <bde@FreeBSD.org>1997-11-23 06:02:47 +0000
commit8fddd06099d7a807b7c3a10bab738186d50587e7 (patch)
tree24be15a94101f0e68986dd0203d2de0963d2a472 /lib/libc/stdio
parentcb0830ae3fec4e1bce433d81ab66c61df90a5908 (diff)
downloadsrc-test2-8fddd06099d7a807b7c3a10bab738186d50587e7.tar.gz
src-test2-8fddd06099d7a807b7c3a10bab738186d50587e7.zip
Notes
Diffstat (limited to 'lib/libc/stdio')
-rw-r--r--lib/libc/stdio/vfscanf.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/libc/stdio/vfscanf.c b/lib/libc/stdio/vfscanf.c
index 0df372085452..ba4be5cd82c2 100644
--- a/lib/libc/stdio/vfscanf.c
+++ b/lib/libc/stdio/vfscanf.c
@@ -39,7 +39,7 @@
static char sccsid[] = "@(#)vfscanf.c 8.1 (Berkeley) 6/4/93";
#endif
static const char rcsid[] =
- "$Id: vfscanf.c,v 1.10 1997/04/04 19:07:02 ache Exp $";
+ "$Id: vfscanf.c,v 1.11 1997/07/01 17:46:39 jkh Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
@@ -64,7 +64,7 @@ static const char rcsid[] =
* Flags used during conversion.
*/
#define LONG 0x01 /* l: long or double */
-#define LONGDBL 0x02 /* L: long double; unimplemented */
+#define LONGDBL 0x02 /* L: long double */
#define SHORT 0x04 /* h: short */
#define SUPPRESS 0x08 /* suppress assignment */
#define POINTER 0x10 /* weird %p pointer (`fake hex') */
@@ -655,8 +655,11 @@ literal:
double res;
*p = 0;
- res = strtod(buf,(char **) NULL);
- if (flags & LONG)
+ /* XXX this loses precision for long doubles. */
+ res = strtod(buf, (char **) NULL);
+ if (flags & LONGDBL)
+ *va_arg(ap, long double *) = res;
+ else if (flags & LONG)
*va_arg(ap, double *) = res;
else
*va_arg(ap, float *) = res;