]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Fix check/write order in LHNETADDRESS_ToString.
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 4 Feb 2015 12:24:09 +0000 (12:24 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 4 Feb 2015 12:24:09 +0000 (12:24 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12143 d7cf8633-e32d-0410-b094-e92efae38249

lhnet.c

diff --git a/lhnet.c b/lhnet.c
index e3bc6b712186f54dd511fd4165ddfc2f54fa3c88..229825711dad97a57819daa6750fc8c127636473 100644 (file)
--- a/lhnet.c
+++ b/lhnet.c
@@ -535,9 +535,9 @@ int LHNETADDRESS_ToString(const lhnetaddress_t *vaddress, char *string, int stri
 {
        lhnetaddressnative_t *address = (lhnetaddressnative_t *)vaddress;
        const unsigned char *a;
-       *string = 0;
        if (!address || !string || stringbuffersize < 1)
                return 0;
+       *string = 0;
        switch(address->addresstype)
        {
        default: