//echo ... $portfree(-3923)
... $true
//echo ... $portfree(bug)
... $true
If the requested port check isn't a number between 1-65535 it should return $false.
The bug seems to be even more complicated:
All socket commands seem to work with all numbers except 0.
//echo $portfree(-123)
echoes $true
/socklisten blah -123
no errors
//echo $portfree(-123)
echoes $false
/socklist
echoes this:
* Open sockets:
blah 213.51.142.93:65413 tcp listening
---------------------------------------------
//echo $portfree(999999999)
echoes $true
/socklisten bloh
no errors
//echo $portfree(999999999)
echoes $false
[/i]socklist[/i]
echoes this:
* Open sockets:
blah 213.51.142.93:65413 tcp listening
bloh 213.51.142.93:51711 tcp listening
//echo $portfree(51711)
echoes $false
---------------------------------------------
//echo $portfree(0)
echoes $true
/socklisten bluh 0
* /socklisten: invalid parameters
With my little knowledge C (and C++) variables has ability to flip over when they go out of range.
integer variable can have range 0-65535
when it gets assigned to 65536(out of range) it flips to 1
and when some1 assings it value of -1 it's actually 65534
same with -123 -> 65536-123=65413
999999999 -> mod(99999999,65536) = 51711
well, just ask from someone who is native <language you know best> speaker...