use the dynamic buffer for both curses and stdout

This commit is contained in:
Bill Currie 2001-09-25 16:19:26 +00:00
parent 9ffe53178c
commit 3909176957

View file

@ -174,13 +174,10 @@ C_Shutdown (void)
static void
C_Print (const char *fmt, va_list args)
{
#ifdef HAVE_CURSES_H
if (use_curses) {
char *txt;
static char *buffer;
static unsigned char *buffer;
unsigned char *txt;
int size;
static int buffer_size;
chtype ch;
size = vsnprintf (buffer, buffer_size, fmt, args);
if (size + 1 > buffer_size) {
@ -193,6 +190,11 @@ C_Print (const char *fmt, va_list args)
}
txt = buffer;
#ifdef HAVE_CURSES_H
if (use_curses) {
chtype ch;
txt = buffer;
while ((ch = (byte)*txt++)) {
ch = sys_char_map[ch] | attr_table[attr_map[ch]];
@ -203,12 +205,8 @@ C_Print (const char *fmt, va_list args)
} else
#endif
{
char msg[4096];
unsigned char *p;
vsnprintf (msg, sizeof (msg), fmt, args);
for (p = (unsigned char *) msg; *p; p++)
putc (sys_char_map[*p], stdout);
while (*txt)
putc (sys_char_map[*txt++], stdout);
fflush (stdout);
}
}