Re: erlang:binary_to_integer(<<"+">>) returns 0

Mikael Pettersson <[email protected]> Fri, 31 Jul 2015 21:26:40 +0200
Newsgroups gmane.comp.lang.erlang.bugs
Message-ID <[email protected]>
-E:), niku writes:
 > Hi folks.
 > 
 > erlang:binary_to_integer(<<"+">>) and
 > erlang:binary_to_integer(<<"-">>) return 0
 > 
 > I think it should cause exception same as erlang:list_to_integer("+").
 > 
 > Here is an example
 > 
 > $ erl
 > Erlang/OTP 17 [erts-6.4] [source] [64-bit] [smp:4:4]
 > [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
 > 
 > Eshell V6.4  (abort with ^G)
 > 1> binary_to_integer(<<"+">>).
 > 0
 > 2> binary_to_integer(<<"-">>).
 > 0
 > 
 > regards.

Confirmed with otp 18.0.2.

Fix:
https://github.com/erlang/otp/pull/803
_______________________________________________
erlang-bugs mailing list
[email protected]
http://erlang.org/mailman/listinfo/erlang-bugs