aboutsummaryrefslogtreecommitdiff
path: root/ncurses/tty/hardscroll.c
diff options
context:
space:
mode:
Diffstat (limited to 'ncurses/tty/hardscroll.c')
-rw-r--r--ncurses/tty/hardscroll.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/ncurses/tty/hardscroll.c b/ncurses/tty/hardscroll.c
index 7d8979a4f51b..2c40997fb6b1 100644
--- a/ncurses/tty/hardscroll.c
+++ b/ncurses/tty/hardscroll.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -29,6 +29,8 @@
/****************************************************************************
* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ * and: Thomas E. Dickey 1996-on *
+ * and: Alexander V Lukyanov 1997-1998 *
****************************************************************************/
/******************************************************************************
@@ -145,7 +147,7 @@ AUTHOR
#include <curses.priv.h>
-MODULE_ID("$Id: hardscroll.c,v 1.41 2007/09/29 21:48:36 tom Exp $")
+MODULE_ID("$Id: hardscroll.c,v 1.42 2008/08/03 23:49:30 tom Exp $")
#if defined(SCROLLDEBUG) || defined(HASHDEBUG)
@@ -270,13 +272,14 @@ _nc_linedump(void)
char *buf = 0;
size_t want = (screen_lines + 1) * 4;
- buf = typeMalloc(char, want);
+ if ((buf = typeMalloc(char, want)) != 0) {
- (void) strcpy(buf, "virt");
- for (n = 0; n < screen_lines; n++)
- (void) sprintf(buf + strlen(buf), " %02d", OLDNUM(n));
- TR(TRACE_UPDATE | TRACE_MOVE, (buf));
- free(buf);
+ (void) strcpy(buf, "virt");
+ for (n = 0; n < screen_lines; n++)
+ (void) sprintf(buf + strlen(buf), " %02d", OLDNUM(n));
+ TR(TRACE_UPDATE | TRACE_MOVE, (buf));
+ free(buf);
+ }
}
#endif /* defined(TRACE) || defined(SCROLLDEBUG) */