summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2011-01-05 17:38:42 +0000
committerJeff Johnston <jjohnstn@redhat.com>2011-01-05 17:38:42 +0000
commitc0e3c29150f2148f11832d11fd929e5f44b2960b (patch)
tree135e0ef91096f75fc1805863a8f5d6240dca1cd0
parentf559c264a9a8c5503ff09f65fd952fe9eb333e18 (diff)
downloadcygnal-c0e3c29150f2148f11832d11fd929e5f44b2960b.tar.gz
cygnal-c0e3c29150f2148f11832d11fd929e5f44b2960b.tar.bz2
cygnal-c0e3c29150f2148f11832d11fd929e5f44b2960b.zip
2011-01-05 Ralf Corsepius <ralf.corsepius@rtems.org>
* libc/stdio/open_memstream.c (internal_open_memstream_r): Don't limit c->max to 64*1024 on targets with SIZE_MAX < 64*1024.
-rw-r--r--newlib/ChangeLog5
-rw-r--r--newlib/libc/stdio/open_memstream.c2
2 files changed, 7 insertions, 0 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index c5fb3771f..418ec382e 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,5 +1,10 @@
2011-01-05 Ralf Corsepius <ralf.corsepius@rtems.org>
+ * libc/stdio/open_memstream.c (internal_open_memstream_r):
+ Don't limit c->max to 64*1024 on targets with SIZE_MAX < 64*1024.
+
+2011-01-05 Ralf Corsepius <ralf.corsepius@rtems.org>
+
* libc/xdr/xdr.c: Fix typos in #errors.
2011-01-05 Ralf Corsepius <ralf.corsepius@rtems.org>
diff --git a/newlib/libc/stdio/open_memstream.c b/newlib/libc/stdio/open_memstream.c
index 2066822cd..a53bdef2f 100644
--- a/newlib/libc/stdio/open_memstream.c
+++ b/newlib/libc/stdio/open_memstream.c
@@ -330,8 +330,10 @@ _DEFUN(internal_open_memstream_r, (ptr, buf, size, wide),
c->max *= sizeof(wchar_t);
if (c->max < 64)
c->max = 64;
+#if (SIZE_MAX >= 64 * 1024)
else if (c->max > 64 * 1024)
c->max = 64 * 1024;
+#endif
*size = 0;
*buf = _malloc_r (ptr, c->max);
if (!*buf)