aboutsummaryrefslogtreecommitdiffstats
path: root/src/termcap.c
diff options
context:
space:
mode:
authorJoakim Verona2012-07-27 02:22:03 +0200
committerJoakim Verona2012-07-27 02:22:03 +0200
commit5fb63197843dcae66f2fe0ddd6f4a9d560e9db2f (patch)
tree5c55f1096a656a9759f0b53a0b5d1a2289bd366f /src/termcap.c
parent0c5c85cf2b350c965bb1ffa5b2d77c2adebc406b (diff)
parent562157c814037dcba58a20cd6908a95992c22283 (diff)
downloademacs-5fb63197843dcae66f2fe0ddd6f4a9d560e9db2f.tar.gz
emacs-5fb63197843dcae66f2fe0ddd6f4a9d560e9db2f.zip
upstream
Diffstat (limited to 'src/termcap.c')
-rw-r--r--src/termcap.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/termcap.c b/src/termcap.c
index 61f9d9a31ea..d1b05e8df94 100644
--- a/src/termcap.c
+++ b/src/termcap.c
@@ -153,7 +153,7 @@ tgetst1 (char *ptr, char **area)
153 p = ptr; 153 p = ptr;
154 while ((c = *p++) && c != ':' && c != '\n') 154 while ((c = *p++) && c != ':' && c != '\n')
155 ; 155 ;
156 ret = (char *) xmalloc (p - ptr + 1); 156 ret = xmalloc (p - ptr + 1);
157 } 157 }
158 else 158 else
159 ret = *area; 159 ret = *area;
@@ -377,7 +377,7 @@ tgetent (char *bp, const char *name)
377 if (!bp) 377 if (!bp)
378 { 378 {
379 malloc_size = 1 + strlen (term); 379 malloc_size = 1 + strlen (term);
380 bp = (char *) xmalloc (malloc_size); 380 bp = xmalloc (malloc_size);
381 } 381 }
382 strcpy (bp, term); 382 strcpy (bp, term);
383 goto ret; 383 goto ret;
@@ -440,13 +440,13 @@ tgetent (char *bp, const char *name)
440 440
441 buf.size = BUFSIZE; 441 buf.size = BUFSIZE;
442 /* Add 1 to size to ensure room for terminating null. */ 442 /* Add 1 to size to ensure room for terminating null. */
443 buf.beg = (char *) xmalloc (buf.size + 1); 443 buf.beg = xmalloc (buf.size + 1);
444 term = indirect ? indirect : (char *)name; 444 term = indirect ? indirect : (char *)name;
445 445
446 if (!bp) 446 if (!bp)
447 { 447 {
448 malloc_size = indirect ? strlen (tcenv) + 1 : buf.size; 448 malloc_size = indirect ? strlen (tcenv) + 1 : buf.size;
449 bp = (char *) xmalloc (malloc_size); 449 bp = xmalloc (malloc_size);
450 } 450 }
451 tc_search_point = bp1 = bp; 451 tc_search_point = bp1 = bp;
452 452
@@ -478,7 +478,7 @@ tgetent (char *bp, const char *name)
478 { 478 {
479 ptrdiff_t offset1 = bp1 - bp, offset2 = tc_search_point - bp; 479 ptrdiff_t offset1 = bp1 - bp, offset2 = tc_search_point - bp;
480 malloc_size = offset1 + buf.size; 480 malloc_size = offset1 + buf.size;
481 bp = termcap_name = (char *) xrealloc (bp, malloc_size); 481 bp = termcap_name = xrealloc (bp, malloc_size);
482 bp1 = termcap_name + offset1; 482 bp1 = termcap_name + offset1;
483 tc_search_point = termcap_name + offset2; 483 tc_search_point = termcap_name + offset2;
484 } 484 }
@@ -504,7 +504,7 @@ tgetent (char *bp, const char *name)
504 xfree (buf.beg); 504 xfree (buf.beg);
505 505
506 if (malloc_size) 506 if (malloc_size)
507 bp = (char *) xrealloc (bp, bp1 - bp + 1); 507 bp = xrealloc (bp, bp1 - bp + 1);
508 508
509 ret: 509 ret:
510 term_entry = bp; 510 term_entry = bp;