Flash Gordon <sp**@flash-gordon.me.ukwrites:
Jens wrote, On 23/01/07 21:56:
[...]
if (port 0) /* test for illegal value */
What about a number above 63353? (he says making use of off topic knowledge)
Do you mean 65535 (2**16-1)?
[...]
exit(1);
Non-portable return value. Include stdlib.h at the top then use
exit(EXIT_FAILURE);
Non-portable return values are not unreasonable in non-portable code.
Judging by the non-standard (or other-standard) library routines being
used, it's likely that "exit(1)" is a correct way to indicate an
error.
On the other hand, using "exit(EXIT_FAILURE)" on such systems is
likely to yield identical results.
If the program defines (and documents!) multiple failure codes, and 1
is just one among several such codes, then using exit(1) is reasonable
(though defining and using constants would be better). If you're
just signally generic failure, exit(EXIT_FAILURE) is probably
preferred.
[...]
--
Keith Thompson (The_Other_Keith)
ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.