aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/runtime/environ.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-10-01 13:50:10 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2005-10-01 13:50:10 +0200
commit1449b8cba879ff1bedf7863f63ef079b2026c0a1 (patch)
treebe9e8c61a086ff18a3169c8a58d1c4886f88a747 /libgfortran/runtime/environ.c
parentfdf84417b930dec65dbabe735ca984080079af6e (diff)
downloadgcc-1449b8cba879ff1bedf7863f63ef079b2026c0a1.zip
gcc-1449b8cba879ff1bedf7863f63ef079b2026c0a1.tar.gz
gcc-1449b8cba879ff1bedf7863f63ef079b2026c0a1.tar.bz2
libgfortran.h (GFC_ITOA_BUF_SIZE, [...]): Define.
* libgfortran.h (GFC_ITOA_BUF_SIZE, GFC_XTOA_BUF_SIZE, GFC_OTOA_BUF_SIZE, GFC_BTOA_BUF_SIZE): Define. (gfc_itoa, xtoa): Add 2 extra arguments. * runtime/environ.c: Include stdio.h. (check_buffered): Use sprintf. * runtime/error.c: Include assert.h. (gfc_itoa, xtoa): Add 2 extra arguments, avoid using static buffers. (st_printf, st_sprintf): Adjust callers. * io/write.c (otoa, btoa): Add 2 extra arguments, avoid using static buffers. (write_int, write_decimal): Add 2 extra arguments to conv function pointer, adjust caller. (write_integer): Adjust gfc_itoa caller. * io/unit.c (get_array_unit_len): Return 0 rather than NULL. * io/read.c (read_f): Remove spurious pointer dereference. From-SVN: r104855
Diffstat (limited to 'libgfortran/runtime/environ.c')
-rw-r--r--libgfortran/runtime/environ.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libgfortran/runtime/environ.c b/libgfortran/runtime/environ.c
index e86f2ce..fb5da20 100644
--- a/libgfortran/runtime/environ.c
+++ b/libgfortran/runtime/environ.c
@@ -28,6 +28,7 @@ the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
#include "config.h"
+#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
@@ -580,15 +581,14 @@ init_variables (void)
int
check_buffered (int n)
{
- char name[40];
+ char name[22 + sizeof (n) * 3];
variable v;
int rv;
if (options.all_unbuffered)
return 0;
- strcpy (name, "GFORTRAN_UNBUFFERED_");
- strcat (name, gfc_itoa (n));
+ sprintf (name, "GFORTRAN_UNBUFFERED_%d", n);
v.name = name;
v.value = 2;