It's good practice to initialise your variables when you create them.  If
you don't it may be holding bogus data, therefore not reporting NULL however
at the same time, not doing what you want it to do.

In your instance, if pPlayer points to *something* but not a valid CBP
class, then the first condition of the if statement (!pPlayer = NULL) will
return true, and it will then try to call !pPlayer->IsNetClient() causing
your crash.

It may be working all over in the SDK because in other areas pPlayer is
accurate.  Check in this instance to ensure it is.

Hope that helps

Michael Shimmins
Sesechial Software

_______________________________________________________
Important - This email and any attachments may be confidential. If received
in error, please contact us and delete all copies. Before opening or using
attachments, check them for viruses and defects. Regardless of any loss,
damage or consequence, whether caused by the negligence of the sender or
not, resulting directly or indirectly from the use of any attached files our
liability is limited to resupplying any affected attachments. Any
representations or opinions expressed are those of the individual sender,
and not necessarily those of Sesechial Software.


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of D. Hofer
Sent: Monday, 9 June 2003 11:03 AM
To: [EMAIL PROTECTED]

If the pPlayer pointer is invalid (not initialized) but not NULL then it
can cause a crash.

On Sat, 7 Jun 2003 17:51:38 -0700, James Couzens <[EMAIL PROTECTED]>
wrote:

> All I know, is that, that line of code is littered throughout the SDK in
> the
> util functions, so I figured it was safe to use, but after some looking,
> its
> definately the guilty party, but only on my linux bins.  There are of
> course
> other ways around it, but just frustrating to have that code fail when it
> appears to be widely (and without problems) used in the dmc code.
>
> James
>
> ---
> James Couzens
> ClanMod Dev Team
> WWW: http://unitedadmins.com/clanmod.php
> UA LISTS: http://list.unitedadmins.com/mailman/listinfo
> ----- Original Message -----
> From: "MoD" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Sunday, June 08, 2003 6:43 PM
> Subject: Re: [hlcoders] SDK line crashing linux servers
>
>
>>
>>
>> > No, the C++ specification is such that it always evaluates conditions
>> in a
>> > lazy manner from left to right.
>> >
>> > Persuter
>> >
>>
>> How about, try it his way, and if it works, curse the specification?
>>
>> --
>>
>> MoD.
>>
>> _______________________________________________
>> To unsubscribe, edit your list preferences, or view the list archives,
> please visit:
>> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>>
>>
>>
>
>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives,
> please visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
>
>



_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to