- 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
-
fmtext.c
r099597c r96828e4 640 640 } else if (ptr[0]=='@') { 641 641 /* add the text up to this point then deal with the stack */ 642 buff= owl_malloc(ptr-txtptr+20);642 buff=g_new(char, ptr-txtptr+20); 643 643 strncpy(buff, txtptr, ptr-txtptr); 644 644 buff[ptr-txtptr]='\0'; … … 675 675 /* check what command we've got, push it on the stack, start 676 676 using it, and continue ... unless it's a color command */ 677 buff= owl_malloc(tmpptr-ptr+20);677 buff=g_new(char, tmpptr-ptr+20); 678 678 strncpy(buff, ptr, tmpptr-ptr); 679 679 buff[tmpptr-ptr]='\0'; … … 738 738 739 739 /* grab the color name */ 740 buff= owl_malloc(tmpptr-txtptr+20);740 buff=g_new(char, tmpptr-txtptr+20); 741 741 strncpy(buff, txtptr, tmpptr-txtptr); 742 742 buff[tmpptr-txtptr]='\0'; … … 765 765 } else if (ptr[0]=='}' || ptr[0]==']' || ptr[0]==')' || ptr[0]=='>') { 766 766 /* add the text up to this point first */ 767 buff= owl_malloc(ptr-txtptr+20);767 buff=g_new(char, ptr-txtptr+20); 768 768 strncpy(buff, txtptr, ptr-txtptr); 769 769 buff[ptr-txtptr]='\0'; … … 776 776 /* first, if the stack is empty we must bail (just print and go) */ 777 777 if (stacksize==0) { 778 buff= owl_malloc(5);778 buff=g_new(char, 5); 779 779 buff[0]=ptr[0]; 780 780 buff[1]='\0'; … … 802 802 } else { 803 803 /* otherwise print and continue */ 804 buff= owl_malloc(5);804 buff=g_new(char, 5); 805 805 buff[0]=ptr[0]; 806 806 buff[1]='\0'; … … 812 812 } else { 813 813 /* we've found an unattached opener, print everything and move on */ 814 buff= owl_malloc(ptr-txtptr+20);814 buff=g_new(char, ptr-txtptr+20); 815 815 strncpy(buff, txtptr, ptr-txtptr+1); 816 816 buff[ptr-txtptr+1]='\0'; … … 864 864 short i; 865 865 /* The test is <= because we allocate COLORS+1 entries. */ 866 cpmgr->pairs = owl_malloc((COLORS+1) * sizeof(short*));866 cpmgr->pairs = g_new(short *, COLORS + 1); 867 867 for(i = 0; i <= COLORS; i++) { 868 cpmgr->pairs[i] = owl_malloc((COLORS+1) * sizeof(short));868 cpmgr->pairs[i] = g_new(short, COLORS + 1); 869 869 } 870 870 owl_fmtext_reset_colorpairs(cpmgr);
Note: See TracChangeset
for help on using the changeset viewer.