summaryrefslogtreecommitdiff
path: root/toolchain/musl/patches/028-fix-printf-regression-with-alt-form-octal-zero-flag-and-field-width.patch
diff options
context:
space:
mode:
authorKoen Vandeputte <koen.vandeputte@ncentric.com>2016-12-22 17:17:04 +0100
committerFelix Fietkau <nbd@nbd.name>2016-12-26 11:17:33 +0100
commit2912f9f2a2e5997df069d38e20d85ff4cc51acef (patch)
tree783e8cd472936ac1ca9378f16fb3189a486e7a48 /toolchain/musl/patches/028-fix-printf-regression-with-alt-form-octal-zero-flag-and-field-width.patch
parentb97c933ffb5aae338351a1db12a3f7cf5234f5c7 (diff)
downloadmtk-20170518-2912f9f2a2e5997df069d38e20d85ff4cc51acef.zip
mtk-20170518-2912f9f2a2e5997df069d38e20d85ff4cc51acef.tar.gz
mtk-20170518-2912f9f2a2e5997df069d38e20d85ff4cc51acef.tar.bz2
musl: backport various post-1.1.15 fixes
Backport most important fixes up to latest HEAD - Taken post-commit reverts/fixes into account Compile tested Run-tested on cns3xxx & imx6 targets Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Diffstat (limited to 'toolchain/musl/patches/028-fix-printf-regression-with-alt-form-octal-zero-flag-and-field-width.patch')
-rw-r--r--toolchain/musl/patches/028-fix-printf-regression-with-alt-form-octal-zero-flag-and-field-width.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/toolchain/musl/patches/028-fix-printf-regression-with-alt-form-octal-zero-flag-and-field-width.patch b/toolchain/musl/patches/028-fix-printf-regression-with-alt-form-octal-zero-flag-and-field-width.patch
new file mode 100644
index 0000000..aa0c2cf
--- /dev/null
+++ b/toolchain/musl/patches/028-fix-printf-regression-with-alt-form-octal-zero-flag-and-field-width.patch
@@ -0,0 +1,31 @@
+From 78897b0dc00b7cd5c29af5e0b7eebf2396d8dce0 Mon Sep 17 00:00:00 2001
+From: Rich Felker <dalias@aerifal.cx>
+Date: Fri, 16 Sep 2016 17:40:08 -0400
+Subject: fix printf regression with alt-form octal, zero flag, and field width
+
+commit b91cdbe2bc8b626aa04dc6e3e84345accf34e4b1, in fixing another
+issue, changed the logic for how alt-form octal adds the leading zero
+to adjust the precision rather than using a prefix character. this
+wrongly suppressed the zero flag by mimicing an explicit precision
+given by the format string. switch back to using a prefix character.
+
+based on bug report and patch by Dmitry V. Levin, but simplified.
+---
+ src/stdio/vfprintf.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/stdio/vfprintf.c b/src/stdio/vfprintf.c
+index 2ecf769..e439a07 100644
+--- a/src/stdio/vfprintf.c
++++ b/src/stdio/vfprintf.c
+@@ -570,7 +570,7 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg,
+ if (0) {
+ case 'o':
+ a = fmt_o(arg.i, z);
+- if ((fl&ALT_FORM) && p<z-a+1) p=z-a+1;
++ if ((fl&ALT_FORM) && p<z-a+1) prefix+=5, pl=1;
+ } if (0) {
+ case 'd': case 'i':
+ pl=1;
+--
+cgit v0.11.2