summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/vscanf.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdio/vscanf.c')
-rw-r--r--lib/libc/stdio/vscanf.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/libc/stdio/vscanf.c b/lib/libc/stdio/vscanf.c
index 25bce72..d56bb3b 100644
--- a/lib/libc/stdio/vscanf.c
+++ b/lib/libc/stdio/vscanf.c
@@ -5,6 +5,11 @@
* This code is derived from software contributed to Berkeley by
* Donn Seeley at UUNET Technologies, Inc.
*
+ * Copyright (c) 2011 The FreeBSD Foundation
+ * All rights reserved.
+ * Portions of this software were developed by David Chisnall
+ * under sponsorship from the FreeBSD Foundation.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -41,16 +46,26 @@ __FBSDID("$FreeBSD$");
#include "un-namespace.h"
#include "libc_private.h"
#include "local.h"
+#include "xlocale_private.h"
int
-vscanf(fmt, ap)
+vscanf_l(locale, fmt, ap)
+ locale_t locale;
const char * __restrict fmt;
__va_list ap;
{
int retval;
+ FIX_LOCALE(locale);
FLOCKFILE(stdin);
- retval = __svfscanf(stdin, fmt, ap);
+ retval = __svfscanf(stdin, locale, fmt, ap);
FUNLOCKFILE(stdin);
return (retval);
}
+int
+vscanf(fmt, ap)
+ const char * __restrict fmt;
+ __va_list ap;
+{
+ return vscanf_l(__get_locale(), fmt, ap);
+}
OpenPOWER on IntegriCloud