summaryrefslogtreecommitdiff
path: root/nuttx/lib/lib_sscanf.c
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/lib/lib_sscanf.c')
-rw-r--r--nuttx/lib/lib_sscanf.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/nuttx/lib/lib_sscanf.c b/nuttx/lib/lib_sscanf.c
index 4f100c8ca..efd4ebcfa 100644
--- a/nuttx/lib/lib_sscanf.c
+++ b/nuttx/lib/lib_sscanf.c
@@ -286,7 +286,7 @@ int vsscanf(char *buf, const char *s, va_list ap)
{
/* strtod always returns a double */
- double dvalue = strtod(tmp, NULL);
+ double_t dvalue = strtod(tmp, NULL);
void *pv = va_arg(ap, void*);
vdbg("vsscanf: Return %f to 0x%p\n", dvalue, pv);
@@ -295,11 +295,13 @@ int vsscanf(char *buf, const char *s, va_list ap)
* float or a double.
*/
+#ifdef CONFIG_HAVE_DOUBLE
if (lflag)
{
- *((double*)pv) = dvalue;
+ *((double_t*)pv) = dvalue;
}
else
+#endif
{
*((float*)pv) = (float)dvalue;
}