Update of /cvsroot/plib/plib/src/net
In directory usw-pr-cvs1:/tmp/cvs-serv1626
Modified Files:
netChat.cxx netMonitor.h
Log Message:
removed strdup/free
Index: netChat.cxx
===================================================================
RCS file: /cvsroot/plib/plib/src/net/netChat.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- netChat.cxx 7 Nov 2001 23:51:09 -0000 1.3
+++ netChat.cxx 1 Jul 2002 02:42:57 -0000 1.4
@@ -26,8 +26,8 @@
void
netChat::setTerminator (const char* t)
{
- if (terminator) ::free(terminator);
- terminator = strdup(t);
+ if (terminator) delete[] terminator;
+ terminator = ulStrDup(t);
}
const char*
Index: netMonitor.h
===================================================================
RCS file: /cvsroot/plib/plib/src/net/netMonitor.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- netMonitor.h 18 Dec 2001 16:55:07 -0000 1.6
+++ netMonitor.h 1 Jul 2002 02:42:57 -0000 1.7
@@ -62,9 +62,9 @@
netMonitorServer( cchar* _name, int port )
{
- name = strdup(_name);
- password = strdup("") ;
- prompt = strdup(">>> ");
+ name = ulStrDup(_name);
+ password = ulStrDup("") ;
+ prompt = ulStrDup(">>> ");
cmdfunc = 0 ;
active = 0 ;
@@ -77,22 +77,22 @@
~netMonitorServer()
{
- ::free(name);
- ::free(password) ;
- ::free(prompt) ;
+ delete[] name ;
+ delete[] password ;
+ delete[] prompt ;
}
cchar* getPassword () const { return password; }
void setPassword ( cchar* string )
{
- ::free(password) ;
- password = strdup ( string?string:"" ) ;
+ delete[] password ;
+ password = ulStrDup ( string?string:"" ) ;
}
void setPrompt ( cchar* string )
{
- ::free(prompt) ;
- prompt = strdup ( string?string:"" ) ;
+ delete[] prompt ;
+ prompt = ulStrDup ( string?string:"" ) ;
}
void setCommandFunc ( void (*func)(cchar*) )
|