Using system()in php to call a cgi (in C), which in turn will return a status value.
Whenever a negative value (eg -1) is returned, the php will show it as another value (255).
The sequence is like, -1 = 255, -2 = 254 ...
If it is a positive value then it's working fine.
Was told that it's because C cgi is returning a signed 1 byte integer and PHP isn't reading it as a signed integer but as an unsigned integer.
Any idea is there any function or algorithm that can help solved this problem?