Closed MartynenkoA closed 2 years ago
Interestingly, those parsing results are valid and correct at all!
Actually, if the number has a "0" prefix, it is parsed as an octal format number.
You can see octal "37" represents "31" in decimal number format in the Windows calculator app in "Programmer" mode.
Another example, you can execute the ping command with the argument "0037.15.0.1", and of course, It will work correctly.
In fact, IPv4 address formatting is very funny. All of the following examples represent valid and correct IPv4 addresses!
See also: https://nxmnpg.lemoda.net/3/inet_aton#5
Happy coding! ;)
Is it normal that ip 0037.15.0.1 parsing to 31.15.0.1 17.15.011 parsing to 17.15.0.9
should there be an exception?