Fixed a few cases where free-ed memory blocks were subsequently read.
Removed some unused variables, #includes, other small cleanup.
#include <curses.h>
-#include "curspriv.h"
#include <termcap.h>
extern char *bl, *vb;
#include <curses.h>
-#include "curspriv.h"
/****************************************************************/
/* Winch(win) returns the character at the current position in */
#include <curses.h>
-#include "curspriv.h"
#include <termcap.h>
extern char *vi, *ve, *vs;
#define _FULLWIN 4 /* window fills screen */
#define _SCROLLWIN 8 /* window lwr rgt is screen lwr rgt */
-#define _NO_CHANGE -1 /* flags line edge unchanged */
+#define _NO_CHANGE (-1) /* flags line edge unchanged */
#define _BREAKCHAR 0x03 /* ^C character */
#define _DCCHAR 0x08 /* Delete Char char (BS) */
#define _DLCHAR 0x1b /* Delete Line char (ESC) */
/* Allocate the minchng and maxchng arrays */
if ((win->_minchng = (int *) calloc(num_lines, sizeof(int))) == NULL) {
- free(win);
free(win->_line);
+ free(win);
return((WINDOW *) ERR);
}
if ((win->_maxchng = (int *) calloc(num_lines, sizeof(int))) == NULL) {
- free(win);
free(win->_line);
free(win->_minchng);
+ free(win);
return((WINDOW *) ERR);
}
#include <curses.h>
#include "curspriv.h"
-static bool hasold = FALSE; /* for remembering old cursor type */
-static int oldmode;
-
/****************************************************************/
/* Idlok() is used to set flag for using the terminal insert/ */
/* Delete line capabilities. This is not relevant for the PC */
/* Like the corresponding line in _cursvar.tmpwin. */
/****************************************************************/
-static void transformline(lineno)
-register int lineno;
+static void transformline(register int lineno)
{
register int *dstp;
register int *srcp;
- register int dstc;
- register int srcc;
int x;
int endx;
srcp = twin->_line[lineno] + x;
while (x <= endx) {
- if ((*dstp != *srcp) || (dstc != srcc)) {
+ if (*dstp != *srcp) {
gotoxy(lineno, x);
- while (x <= endx && ((*dstp != *srcp) || (dstc != srcc))) {
+ while (x <= endx && (*dstp != *srcp)) {
Putchar(*srcp);
*dstp++ = *srcp++;
x++;