[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ns] bug in tcl/lib/ns-lib.tcl (ns version ~2.1b7 to present)



Hi,

Anyone ever noticed following bug in procedure bw_parse in
<ns-root>/tcl/lib/ns-lib.tcl (following is diff for tcl/lib/ns-lib.tcl
for ns-2.1b8)?

94c94
<               set unit "[string trimright B $unit]b"
---

>               set unit "[string trimright $unit B]b"

As it was (upper line), any prefix to unit B (bytes) was ignored:
100Bps,100MB/s, 100GB, ... was all converted to 800 (bits/s). However,
parse_bw procedure isn't used all that often, so I figure it wasn't
much of a problem (cf. bound variables in c++ are parsed via 
atof_bw() in Tcl.cc).

[I have the impression that bug existed from the moment support for the
bytes suffix B was added (ns2.1b7 if i'm not mistaken, as it was not
in 2.1b6a yet)... It is still the case for current version of ns
according to CVS history -- ns-lib.tcl,rev.1.232]

Kind regards,
Chris.