summaryrefslogtreecommitdiff
path: root/scanf/sscanf.c
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2001-11-24 22:08:33 +0100
committerKevin Ryde <user42@zip.com.au>2001-11-24 22:08:33 +0100
commit3c08878a3730e8a76369977262a5a8ab534fde7b (patch)
tree793221864d1b710504d8454241984c9f1f4ef8d8 /scanf/sscanf.c
parentb87e10c51477ff6d5fd300529485206b2a2dac0a (diff)
downloadgmp-3c08878a3730e8a76369977262a5a8ab534fde7b.tar.gz
* acinclude.m4, configure.in (GMP_FUNC_SSCANF_WRITABLE_INPUT): New
test. * scanf/sscanf.c, scanf/vsscanf.c: Use it to ensure sscanf input is writable, if necessary.
Diffstat (limited to 'scanf/sscanf.c')
-rw-r--r--scanf/sscanf.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/scanf/sscanf.c b/scanf/sscanf.c
index 90824f9a0..64cb976b2 100644
--- a/scanf/sscanf.c
+++ b/scanf/sscanf.c
@@ -53,7 +53,12 @@ gmp_sscanf (va_alist)
fmt = va_arg (ap, const char *);
#endif
+#if SSCANF_WRITABLE_INPUT
+ /* let gmp_vsscanf handle the copying */
+ ret = gmp_vsscanf (s, fmt, ap);
+#else
ret = __gmp_doscan (&__gmp_sscanf_funs, (void *) &s, fmt, ap);
+#endif
va_end (ap);
return ret;
}