diff options
Diffstat (limited to 'libgfortran/io/unix.c')
-rw-r--r-- | libgfortran/io/unix.c | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c index 4e4bc3b..c257766 100644 --- a/libgfortran/io/unix.c +++ b/libgfortran/io/unix.c @@ -1353,61 +1353,6 @@ error_stream (void) } -/* st_vprintf()-- vprintf function for error output. To avoid buffer - overruns, we limit the length of the buffer to ST_VPRINTF_SIZE. 2k - is big enough to completely fill a 80x25 terminal, so it shuld be - OK. We use a direct write() because it is simpler and least likely - to be clobbered by memory corruption. Writing an error message - longer than that is an error. */ - -#define ST_VPRINTF_SIZE 2048 - -int -st_vprintf (const char *format, va_list ap) -{ - static char buffer[ST_VPRINTF_SIZE]; - int written; - int fd; - - fd = options.use_stderr ? STDERR_FILENO : STDOUT_FILENO; -#ifdef HAVE_VSNPRINTF - written = vsnprintf(buffer, ST_VPRINTF_SIZE, format, ap); -#else - written = vsprintf(buffer, format, ap); - - if (written >= ST_VPRINTF_SIZE-1) - { - /* The error message was longer than our buffer. Ouch. Because - we may have messed up things badly, report the error and - quit. */ -#define ERROR_MESSAGE "Internal error: buffer overrun in st_vprintf()\n" - write (fd, buffer, ST_VPRINTF_SIZE-1); - write (fd, ERROR_MESSAGE, strlen(ERROR_MESSAGE)); - sys_exit(2); -#undef ERROR_MESSAGE - - } -#endif - - written = write (fd, buffer, written); - return written; -} - -/* st_printf()-- printf() function for error output. This just calls - st_vprintf() to do the actual work. */ - -int -st_printf (const char *format, ...) -{ - int written; - va_list ap; - va_start (ap, format); - written = st_vprintf(format, ap); - va_end (ap); - return written; -} - - /* compare_file_filename()-- Given an open stream and a fortran string * that is a filename, figure out if the file is the same as the * filename. */ |