gethostbyname() returns NULL if an error occured.
Expressions such as (a = b + c) evaluate to whatever value is assigned
to "a" so we can do things like
if ( a = b + c ) {
// a != 0
} else {
// a == 0
}
This is a little tricky, so if gethostbyname() fails, host_info will
be assigned a value of NULL and the whole entire expression then
evaluates to NULL so this should work (at least on systems that define
NULL to be 0x00.)
That said, the entire NetworkOLK module is only half implimented, and
not really useful at this point. We really need someone to come along
and finish it, or perhaps reimpliment this functionality from scratch
using the plib networking libs.
Regards,
Curt.
D Luff writes:
> In net_send.cxx, in NetworkOLK, we have the following at line 262:
>
> if (host_info = gethostbyname( src_host)) {
>
> at line 270:
>
> if (host_info = gethostbyname( fgd_host)) {
>
> and at line 298:
>
> if (host_info = gethostbyname( fgd_host_check)) {
>
>
> Surely these are mistakes?
>
> Cheers - Dave
>
> --
> [EMAIL PROTECTED]
>
> _______________________________________________
> Flightgear-devel mailing list
> [EMAIL PROTECTED]
> http://mail.flightgear.org/mailman/listinfo/flightgear-devel
--
Curtis Olson IVLab / HumanFIRST Program FlightGear Project
Twin Cities [EMAIL PROTECTED] [EMAIL PROTECTED]
Minnesota http://www.menet.umn.edu/~curt http://www.flightgear.org
_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel