- Timestamp:
- Feb 11, 2011, 4:31:33 PM (14 years ago)
- Branches:
- master, release-1.10, release-1.8, release-1.9
- Children:
- 35b6eb9
- Parents:
- 9518a85
- git-author:
- Anders Kaseorg <andersk@mit.edu> (08/27/09 00:51:45)
- git-committer:
- Anders Kaseorg <andersk@mit.edu> (02/11/11 16:31:33)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
editwin.c
r5f8ec6b r96828e4 72 72 static owl_editwin *owl_editwin_allocate(void) 73 73 { 74 owl_editwin *e; 75 e = owl_malloc(sizeof(owl_editwin)); 76 memset(e, 0, sizeof(*e)); 74 owl_editwin *e = g_new0(owl_editwin, 1); 77 75 e->refcount = 1; 78 76 return e; … … 123 121 owl_history *hist) 124 122 { 125 e->buff= owl_malloc(INCR);123 e->buff=g_new(char, INCR); 126 124 e->buff[0]='\0'; 127 125 e->bufflen=0; … … 303 301 304 302 if (lock > 0) { 305 locktext = owl_malloc(lock+1);303 locktext = g_new(char, lock+1); 306 304 strncpy(locktext, e->buff, lock); 307 305 locktext[lock] = 0; … … 382 380 owl_editwin_excursion *owl_editwin_begin_excursion(owl_editwin *e) 383 381 { 384 owl_editwin_excursion *x = owl_malloc(sizeof *x);382 owl_editwin_excursion *x = g_new(owl_editwin_excursion, 1); 385 383 oe_save_excursion(e, x); 386 384 return x; … … 747 745 return; 748 746 749 tmp = owl_malloc((end - start) + 1);747 tmp = g_new(char, (end - start) + 1); 750 748 tmp[(end - start)] = 0; 751 749 memcpy(tmp, middle, end - middle); … … 1072 1070 char *killbuf = owl_global_get_kill_buffer(&g); 1073 1071 1074 p = owl_malloc(len + 1);1072 p = g_new(char, len + 1); 1075 1073 1076 1074 if (p != NULL) { … … 1408 1406 char *p; 1409 1407 1410 p = owl_malloc(end - start + 1);1408 p = g_new(char, end - start + 1); 1411 1409 memcpy(p, e->buff + start, end - start); 1412 1410 p[end - start] = 0;
Note: See TracChangeset
for help on using the changeset viewer.