X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Ftty%2Fhardscroll.c;h=abb21cfddfe327a3ce58dc062756e8f8071ab926;hp=d6f28d67f97d7a87c1065452724072d41f9105a2;hb=790a85dbd4a81d5f5d8dd02a44d84f01512ef443;hpb=6a530b46563470c2ca73579d1994a0c8e275dd98;ds=sidebyside diff --git a/ncurses/tty/hardscroll.c b/ncurses/tty/hardscroll.c index d6f28d67..abb21cfd 100644 --- a/ncurses/tty/hardscroll.c +++ b/ncurses/tty/hardscroll.c @@ -1,5 +1,6 @@ /**************************************************************************** - * Copyright (c) 1998-2012,2015 Free Software Foundation, Inc. * + * Copyright 2020 Thomas E. Dickey * + * Copyright 1998-2015,2016 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 * @@ -147,7 +148,7 @@ AUTHOR #include -MODULE_ID("$Id: hardscroll.c,v 1.52 2015/07/25 20:13:07 tom Exp $") +MODULE_ID("$Id: hardscroll.c,v 1.54 2020/02/02 23:34:34 tom Exp $") #if defined(SCROLLDEBUG) || defined(HASHDEBUG) @@ -300,12 +301,12 @@ NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_linedump) (NCURSES_SP_DCL0) /* dump the state of the real and virtual oldnum fields */ { - int n; char *buf = 0; size_t want = ((size_t) screen_lines(SP_PARM) + 1) * 4; (void) SP_PARM; if ((buf = typeMalloc(char, want)) != 0) { + int n; *buf = '\0'; for (n = 0; n < screen_lines(SP_PARM); n++)