diff options
Diffstat (limited to 'src/termcap.c')
-rw-r--r-- | src/termcap.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/src/termcap.c b/src/termcap.c index 10c195eebe..d1b05e8df9 100644 --- a/src/termcap.c +++ b/src/termcap.c @@ -30,10 +30,6 @@ Boston, MA 02110-1301, USA. */ #include "msdos.h" #endif -#ifndef NULL -#define NULL (char *) 0 -#endif - /* BUFSIZE is the initial size allocated for the buffer for reading the termcap file. It is not a limit. @@ -157,7 +153,7 @@ tgetst1 (char *ptr, char **area) p = ptr; while ((c = *p++) && c != ':' && c != '\n') ; - ret = (char *) xmalloc (p - ptr + 1); + ret = xmalloc (p - ptr + 1); } else ret = *area; @@ -381,7 +377,7 @@ tgetent (char *bp, const char *name) if (!bp) { malloc_size = 1 + strlen (term); - bp = (char *) xmalloc (malloc_size); + bp = xmalloc (malloc_size); } strcpy (bp, term); goto ret; @@ -444,13 +440,13 @@ tgetent (char *bp, const char *name) buf.size = BUFSIZE; /* Add 1 to size to ensure room for terminating null. */ - buf.beg = (char *) xmalloc (buf.size + 1); + buf.beg = xmalloc (buf.size + 1); term = indirect ? indirect : (char *)name; if (!bp) { malloc_size = indirect ? strlen (tcenv) + 1 : buf.size; - bp = (char *) xmalloc (malloc_size); + bp = xmalloc (malloc_size); } tc_search_point = bp1 = bp; @@ -482,7 +478,7 @@ tgetent (char *bp, const char *name) { ptrdiff_t offset1 = bp1 - bp, offset2 = tc_search_point - bp; malloc_size = offset1 + buf.size; - bp = termcap_name = (char *) xrealloc (bp, malloc_size); + bp = termcap_name = xrealloc (bp, malloc_size); bp1 = termcap_name + offset1; tc_search_point = termcap_name + offset2; } @@ -508,7 +504,7 @@ tgetent (char *bp, const char *name) xfree (buf.beg); if (malloc_size) - bp = (char *) xrealloc (bp, bp1 - bp + 1); + bp = xrealloc (bp, bp1 - bp + 1); ret: term_entry = bp; @@ -661,10 +657,6 @@ gobble_line (int fd, register struct termcap_buffer *bufp, char *append_end) #ifdef TEST -#ifdef NULL -#undef NULL -#endif - #include <stdio.h> static void |