[ET Trac] [Einstein Toolkit] #1544: disallow empty value strings when setting numbers in CCTK_ParameterSet

Einstein Toolkit trac-noreply at einsteintoolkit.org
Wed Feb 12 15:41:42 CST 2014


#1544: disallow empty value strings when setting numbers in CCTK_ParameterSet
--------------------+-------------------------------------------------------
 Reporter:  rhaas   |       Owner:                     
     Type:  defect  |      Status:  new                
 Priority:  minor   |   Milestone:                     
Component:  Cactus  |     Version:  development version
 Keywords:          |  
--------------------+-------------------------------------------------------
 Currently due to the way strtol and strtod work one can do
 {{{
 CCTK_ParameterSet("cctk_itlast", "Cactus", "")
 }}}
 which return 0 (all is fine) and sets cctk_itlast to 0 (rather than
 failing with -6 "invalid string").

 The attached patch checks that the parameter value string is not empty.

 This cannot happen from inside of parfiles since the parser disallows it.
 It can happen when using the Trigger thorn.

-- 
Ticket URL: <https://trac.einsteintoolkit.org/ticket/1544>
Einstein Toolkit <http://einsteintoolkit.org>
The Einstein Toolkit


More information about the Trac mailing list