Commit 0a06e078 authored by Chris Allegretta's avatar Chris Allegretta
Browse files

replace for loop for hline init with memset in init functions

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@501 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
parent 17276e50
Showing with 7 additions and 14 deletions
+7 -14
......@@ -21,6 +21,8 @@ General
- Added restoration of totsize after unjustify command.
usage()
- Add arg to -T help (Rocco).
global_init(), handle_sigwinch()
- Messy loops replaced with memset calls (Rocco).
nano 0.9.99pre1 - 01/17/2001
General
......
......@@ -167,8 +167,6 @@ void clear_filename(void)
/* Initialize global variables - no better way for now */
void global_init(void)
{
int i;
current_x = 0;
current_y = 0;
......@@ -190,11 +188,8 @@ void global_init(void)
die_too_small();
hblank = nmalloc(COLS + 1);
/* Thanks BG for this bit... */
for (i = 0; i <= COLS - 1; i++)
hblank[i] = ' ';
hblank[i] = 0;
memset(hblank, ' ', COLS);
hblank[COLS] = 0;
}
#ifndef DISABLE_HELP
......@@ -1543,7 +1538,6 @@ void handle_sigwinch(int s)
char *tty = NULL;
int fd = 0;
int result = 0;
int i = 0;
struct winsize win;
tty = ttyname(0);
......@@ -1566,12 +1560,9 @@ void handle_sigwinch(int s)
if ((fill = COLS - CHARS_FROM_EOL) < MIN_FILL_LENGTH)
die_too_small();
free(hblank);
hblank = nmalloc(COLS + 1);
for (i = 0; i <= COLS - 1; i++)
hblank[i] = ' ';
hblank[i] = 0;
hblank = nrealloc(hblank, COLS + 1);
memset(hblank, ' ', COLS);
hblank[COLS] = 0;
#ifdef HAVE_NCURSES_H
resizeterm(LINES, COLS);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment