OMNeT++/OMNEST Bug Tracker - OMNeT++
View Issue Details
0000232OMNeT++simulation kernelpublic2010-12-23 12:312010-12-23 15:18
andras 
andras 
normalminoralways
resolvedfixed 
4.1 
4.2 
0000232: Configuration: runnumber-width option causes seed-set to be interpreted as an octal number
When setting runnumber-width > 1 in the configuration, runs 0..7 work fine, but run 8 and 9 stop with the following error:

<!> Error: Error getting option seed-set= from the configuration: `008' is not a valid integer.

To reproduce:
1. edit the omnetpp.ini file in aloha, and add "runnumber-width = 3" into the [Config PureAlohaExperiment] section.
2. run the simulation with: ./aloha -c PureAlohaExperiment -r 8 -u Cmdenv
3. you'll get the above error
No tags attached.
? commit-3c4ed78 (3,730) 2010-12-23 15:18
https://dev.omnetpp.org/bugs/file_download.php?file_id=54&type=bug
Issue History
2010-12-23 12:31andrasNew Issue
2010-12-23 12:40andrasNote Added: 0000363
2010-12-23 15:18andrasFile Added: commit-3c4ed78
2010-12-23 15:18andrasNote Added: 0000364
2010-12-23 15:18andrasStatusnew => resolved
2010-12-23 15:18andrasFixed in Version => 4.2
2010-12-23 15:18andrasResolutionopen => fixed
2010-12-23 15:18andrasAssigned To => andras

Notes
(0000363)
andras   
2010-12-23 12:40   
Quick fix (with side effects):

--- stringutil.cc 2010-06-11 20:37:02 +0200
+++ stringutil.cc-fix 2010-12-23 11:35:07 +0100
@@ -440,7 +440,7 @@

 long opp_strtol(const char *s, char **endptr) {
- long d = strtol(s, endptr, 0);
+ long d = strtol(s, endptr, 10);
     if ((d==LONG_MAX || d==LONG_MIN) && errno==ERANGE)
         throw opp_runtime_error("overflow converting `%s' to long", s);
     return d;

However, this will cause OMNeT++ not to recognize hex and octal constants in NED and ini files.
(0000364)
andras   
2010-12-23 15:18   
See attached fix.