diff options
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | ChangeLogs/ChangeLog-02a | 9 | ||||
-rw-r--r-- | ChangeLogs/ChangeLog-03a | 9 | ||||
-rw-r--r-- | TAO/ChangeLogs/ChangeLog-02a | 7 | ||||
-rw-r--r-- | TAO/TAO_IDL/driver/drv_preproc.cpp | 2 | ||||
-rw-r--r-- | TAO/orbsvcs/IFR_Service/drv_preproc_ifr.cpp | 2 | ||||
-rw-r--r-- | ace/ACE.h | 3 | ||||
-rw-r--r-- | ace/ACE.i | 4 | ||||
-rw-r--r-- | ace/Parse_Node.cpp | 10 |
9 files changed, 46 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog index c4b33a96b37..00d130bce4f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Sun Dec 30 16:54:18 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu> + + * ace/Parse_Node.cpp: Now that ACE::strnew() checks for a NULL + parameter, we can remove the checks in the ACE code. + + * ace/ACE.i (strnew): Check to see if the pointer passed to + ACE::strnew() is non-NULL. Thanks to Don Hinton for reporting + this. + Sat Dec 29 18:36:13 2001 Douglas C. Schmidt <schmidt@ace.cs.wustl.edu> * ace/OS.i (putenv): Fixed a typo. Thanks to Venkita for diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a index c4b33a96b37..00d130bce4f 100644 --- a/ChangeLogs/ChangeLog-02a +++ b/ChangeLogs/ChangeLog-02a @@ -1,3 +1,12 @@ +Sun Dec 30 16:54:18 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu> + + * ace/Parse_Node.cpp: Now that ACE::strnew() checks for a NULL + parameter, we can remove the checks in the ACE code. + + * ace/ACE.i (strnew): Check to see if the pointer passed to + ACE::strnew() is non-NULL. Thanks to Don Hinton for reporting + this. + Sat Dec 29 18:36:13 2001 Douglas C. Schmidt <schmidt@ace.cs.wustl.edu> * ace/OS.i (putenv): Fixed a typo. Thanks to Venkita for diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a index c4b33a96b37..00d130bce4f 100644 --- a/ChangeLogs/ChangeLog-03a +++ b/ChangeLogs/ChangeLog-03a @@ -1,3 +1,12 @@ +Sun Dec 30 16:54:18 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu> + + * ace/Parse_Node.cpp: Now that ACE::strnew() checks for a NULL + parameter, we can remove the checks in the ACE code. + + * ace/ACE.i (strnew): Check to see if the pointer passed to + ACE::strnew() is non-NULL. Thanks to Don Hinton for reporting + this. + Sat Dec 29 18:36:13 2001 Douglas C. Schmidt <schmidt@ace.cs.wustl.edu> * ace/OS.i (putenv): Fixed a typo. Thanks to Venkita for diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a index 5a5c000093e..fe49b3584f6 100644 --- a/TAO/ChangeLogs/ChangeLog-02a +++ b/TAO/ChangeLogs/ChangeLog-02a @@ -1,3 +1,10 @@ +Sun Dec 30 17:02:24 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu> + + * orbsvcs/IFR_Service/drv_preproc_ifr.cpp: + * TAO_IDL/driver/drv_preproc.cpp (DRV_cpp_putarg): + Now that ACE::strnew() checks for a NULL parameter, we can + remove the checks in the TAO code. + Sun Dec 30 20:30:12 2001 Johnny Willemsen <jwillemsen@remedy.nl> * orbsvcs/orbsvcs/CosEvent.bor: diff --git a/TAO/TAO_IDL/driver/drv_preproc.cpp b/TAO/TAO_IDL/driver/drv_preproc.cpp index 9c63284c95d..28cabc2953a 100644 --- a/TAO/TAO_IDL/driver/drv_preproc.cpp +++ b/TAO/TAO_IDL/driver/drv_preproc.cpp @@ -107,7 +107,7 @@ DRV_cpp_putarg (const char *str) ACE_OS::exit (99); } - arglist[argcount++] = str == 0 ? 0 : ACE::strnew (str); + arglist[argcount++] = ACE::strnew (str); } // Expand the output argument with the given filename. diff --git a/TAO/orbsvcs/IFR_Service/drv_preproc_ifr.cpp b/TAO/orbsvcs/IFR_Service/drv_preproc_ifr.cpp index 63b6261245f..19e6a6707e5 100644 --- a/TAO/orbsvcs/IFR_Service/drv_preproc_ifr.cpp +++ b/TAO/orbsvcs/IFR_Service/drv_preproc_ifr.cpp @@ -107,7 +107,7 @@ DRV_cpp_putarg (const char *str) ACE_OS::exit (99); } - arglist[argcount++] = str == 0 ? 0 : ACE::strnew (str); + arglist[argcount++] = ACE::strnew (str); } // Expand the output argument with the given filename. diff --git a/ace/ACE.h b/ace/ACE.h index 414644718ad..917e1c4e8cc 100644 --- a/ace/ACE.h +++ b/ace/ACE.h @@ -363,7 +363,8 @@ public: static const char *strend (const char *s); /// This method is just like <strdup>, except that it uses <operator - /// new> rather than <malloc>. + /// new> rather than <malloc>. If <s> is NULL returns NULL rather than + /// segfaulting... static char *strnew (const char *s); /// Create a fresh new copy of <str>, up to <n> chars long. Uses diff --git a/ace/ACE.i b/ace/ACE.i index 889bdab9701..28d27af017b 100644 --- a/ace/ACE.i +++ b/ace/ACE.i @@ -314,9 +314,11 @@ ACE::debug (char c) ASYS_INLINE char * ACE::strnew (const char *s) { + if (s == 0) + return 0; char *t = 0; ACE_NEW_RETURN (t, - char [::strlen(s) + 1], + char [::strlen (s) + 1], 0); if (t == 0) return 0; diff --git a/ace/Parse_Node.cpp b/ace/Parse_Node.cpp index 89daaa08897..899398bae90 100644 --- a/ace/Parse_Node.cpp +++ b/ace/Parse_Node.cpp @@ -104,7 +104,7 @@ ACE_Parse_Node::ACE_Parse_Node (void) ACE_Parse_Node::ACE_Parse_Node (const ACE_TCHAR *nm) - : name_ (nm ? ACE::strnew (nm) : 0), + : name_ (ACE::strnew (nm)), next_ (0) { ACE_TRACE ("ACE_Parse_Node::ACE_Parse_Node"); @@ -271,7 +271,7 @@ ACE_Static_Node::dump (void) const ACE_Static_Node::ACE_Static_Node (const ACE_TCHAR *nm, ACE_TCHAR *params) : ACE_Parse_Node (nm), - parameters_ (params ? ACE::strnew (params) : 0) + parameters_ (ACE::strnew (params)) { ACE_TRACE ("ACE_Static_Node::ACE_Static_Node"); } @@ -407,7 +407,7 @@ ACE_Object_Node::ACE_Object_Node (const ACE_TCHAR *path, : object_name_ (obj_name ? ACE_Lib_Find::ldname (obj_name) : 0) { ACE_TRACE ("ACE_Object_Node::ACE_Object_Node"); - this->pathname (path ? ACE::strnew (path) : 0); + this->pathname (ACE::strnew (path)); this->must_delete_ = 0; } @@ -457,7 +457,7 @@ ACE_Function_Node::ACE_Function_Node (const ACE_TCHAR *path, : function_name_ (func_name ? ACE_Lib_Find::ldname (func_name) : 0) { ACE_TRACE ("ACE_Function_Node::ACE_Function_Node"); - this->pathname (path ? ACE::strnew (path) : 0); + this->pathname (ACE::strnew (path)); this->must_delete_ = 1; } @@ -580,7 +580,7 @@ ACE_Static_Function_Node::dump (void) const } ACE_Static_Function_Node::ACE_Static_Function_Node (const ACE_TCHAR *func_name) - : function_name_ (func_name ? ACE::strnew (func_name) : 0) + : function_name_ (ACE::strnew (func_name)) { ACE_TRACE ("ACE_Static_Function_Node::ACE_Static_Function_Node"); this->must_delete_ = 1; |