diff options
author | Kevin Ryde <user42@zip.com.au> | 2001-11-24 22:08:33 +0100 |
---|---|---|
committer | Kevin Ryde <user42@zip.com.au> | 2001-11-24 22:08:33 +0100 |
commit | 3c08878a3730e8a76369977262a5a8ab534fde7b (patch) | |
tree | 793221864d1b710504d8454241984c9f1f4ef8d8 /scanf/sscanf.c | |
parent | b87e10c51477ff6d5fd300529485206b2a2dac0a (diff) | |
download | gmp-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.c | 5 |
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; } |