[Plib-cvs] plib/src/pui pu.cxx,1.57,1.58 pu.h,1.128,1.129 puFilePicker.cxx,1.29,1.30 puLargeInput.cx
Brought to you by:
sjbaker
From: Sebastian U. <ud...@us...> - 2002-09-15 01:00:27
|
Update of /cvsroot/plib/plib/src/pui In directory usw-pr-cvs1:/tmp/cvs-serv19552 Modified Files: pu.cxx pu.h puFilePicker.cxx puLargeInput.cxx Log Message: Replaced some instances of 'new' + strcpy () with ulStrDup () Index: pu.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/pu.cxx,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- pu.cxx 2 Sep 2002 06:05:44 -0000 1.57 +++ pu.cxx 15 Sep 2002 01:00:21 -0000 1.58 @@ -477,8 +477,7 @@ void puSetPasteBuffer ( char *ch ) { delete [] input_paste_buffer ; - input_paste_buffer = new char [ strlen(ch) + 1 ] ; - strcpy ( input_paste_buffer, ch ) ; + input_paste_buffer = ulStrDup ( ch ) ; } char *puGetPasteBuffer ( void ) { return input_paste_buffer ; } Index: pu.h =================================================================== RCS file: /cvsroot/plib/plib/src/pui/pu.h,v retrieving revision 1.128 retrieving revision 1.129 diff -u -d -r1.128 -r1.129 --- pu.h 2 Sep 2002 13:47:02 -0000 1.128 +++ pu.h 15 Sep 2002 01:00:23 -0000 1.129 @@ -1543,10 +1543,7 @@ delete [] valid_data ; if ( data != NULL ) - { - valid_data = new char [ strlen ( data ) + 1 ] ; - strcpy ( valid_data, data ) ; - } + valid_data = ulStrDup ( data ) ; else valid_data = NULL ; } Index: puFilePicker.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puFilePicker.cxx,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- puFilePicker.cxx 2 Sep 2002 06:05:45 -0000 1.29 +++ puFilePicker.cxx 15 Sep 2002 01:00:23 -0000 1.30 @@ -526,10 +526,7 @@ strcat ( files [ ifile ], "]" ) ; } else - { - files[ ifile ] = new char[ strlen(dp->d_name)+1 ] ; - strcpy ( files [ ifile ], dp->d_name ) ; - } + files[ ifile ] = ulStrDup ( dp->d_name ) ; } files [ ifile ] = NULL ; Index: puLargeInput.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puLargeInput.cxx,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- puLargeInput.cxx 2 Sep 2002 06:05:45 -0000 1.38 +++ puLargeInput.cxx 15 Sep 2002 01:00:23 -0000 1.39 @@ -747,8 +747,7 @@ // Get the line number and position on the line of the mouse char *strval = bottom_slider ? getText () : getWrappedText () ; - char *tmpval = new char [ strlen(strval) + 1 ] ; - strcpy ( tmpval, strval ) ; + char *tmpval = ulStrDup ( strval ) ; int i = strlen ( tmpval ) ; @@ -821,10 +820,11 @@ select_end_position = select_start_position ; select_start_position = i ; } - } else highlight () ; + + delete [] tmpval ; } else lowlight () ; |