diff options
author | A. Wilcox <awilcox@wilcox-tech.com> | 2019-02-21 16:56:45 +0000 |
---|---|---|
committer | A. Wilcox <awilcox@wilcox-tech.com> | 2019-02-21 16:56:45 +0000 |
commit | 76bc29874fd5fd4f772b9aae73c5760516f0cc5a (patch) | |
tree | 4ef41155cf23f6303df8b2049e903e1525266400 /user/tf/0002-Correct-use-of-va_list.patch | |
parent | 771372edf66f59cd0cd77c652e58ff4584a73d1f (diff) | |
parent | a46991ed1070857203f2203c4360d786cce44add (diff) | |
download | packages-76bc29874fd5fd4f772b9aae73c5760516f0cc5a.tar.gz packages-76bc29874fd5fd4f772b9aae73c5760516f0cc5a.tar.bz2 packages-76bc29874fd5fd4f772b9aae73c5760516f0cc5a.tar.xz packages-76bc29874fd5fd4f772b9aae73c5760516f0cc5a.zip |
Merge branch 'tinyfugue' into 'master'
user/tf: new package
See merge request !179
Diffstat (limited to 'user/tf/0002-Correct-use-of-va_list.patch')
-rw-r--r-- | user/tf/0002-Correct-use-of-va_list.patch | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/user/tf/0002-Correct-use-of-va_list.patch b/user/tf/0002-Correct-use-of-va_list.patch new file mode 100644 index 000000000..d13fcd854 --- /dev/null +++ b/user/tf/0002-Correct-use-of-va_list.patch @@ -0,0 +1,34 @@ +From: Russ Allbery <rra@debian.org> +Date: Sun, 17 Feb 2008 22:23:24 -0800 +Subject: Correct use of va_list + +va_copy a va_list before using it in vsprintf so that we don't use the +same va_list repeatedly. Patch taken from the upstream bug tracker +and will apparently be in the next release after 5.0beta8. +--- + src/tfio.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/tfio.c b/src/tfio.c +index 2cd2103..151583e 100644 +--- a/src/tfio.c ++++ b/src/tfio.c +@@ -497,6 +497,7 @@ void vSprintf(String *buf, int flags, const char *fmt, va_list ap) + const conString *Sval; + int len, min, max, leftjust, stars; + attr_t attrs = buf->attrs; ++ va_list ap_copy; + + if (!(flags & SP_APPEND) && buf->data) Stringtrunc(buf, 0); + while (*fmt) { +@@ -522,7 +523,9 @@ void vSprintf(String *buf, int flags, const char *fmt, va_list ap) + case 'x': case 'X': case 'u': case 'o': + case 'f': case 'e': case 'E': case 'g': case 'G': + case 'p': +- vsprintf(tempbuf, spec, ap); ++ va_copy(ap_copy, ap); ++ vsprintf(tempbuf, spec, ap_copy); ++ va_end(ap_copy); + Stringcat(buf, tempbuf); + /* eat the arguments used by vsprintf() */ + while (stars--) (void)va_arg(ap, int); |