Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--newlib/ChangeLog4
-rw-r--r--newlib/libc/stdio/vfprintf.c12
2 files changed, 16 insertions, 0 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index 5c23dece0..d83c52fdd 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,7 @@
+2001-05-28 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * libc/stdio/vfprintf.c (_VFPRINTF_R): Handle printf ("%#.0o",0)
+
2001-05-25 Nick Clifton <nickc@cambridge.redhat.com>
* libc/machine/xscale/memcmp.c: Fix bug when both pointers have
diff --git a/newlib/libc/stdio/vfprintf.c b/newlib/libc/stdio/vfprintf.c
index 9a2cf4fb6..f6bba4979 100644
--- a/newlib/libc/stdio/vfprintf.c
+++ b/newlib/libc/stdio/vfprintf.c
@@ -790,6 +790,18 @@ number: if ((dprec = prec) >= 0)
goto skipsize;
}
}
+ /*
+ * ...result is to be converted to an 'alternate form'.
+ * For o conversion, it increases the precision to force
+ * the first digit of the result to be a zero."
+ * -- ANSI X3J11
+ *
+ * To demonstrate this case, compile and run:
+ * printf ("%#.0o",0);
+ */
+ else if (base == OCT && (flags & ALT))
+ *--cp = '0';
+
size = buf + BUF - cp;
skipsize:
break;