]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - lhnet.c
494
[xonotic/darkplaces.git] / lhnet.c
diff --git a/lhnet.c b/lhnet.c
index 0b63b560758e1bce88607acd01fab3cfefbd09ae..4099ac6809e74a9690b91fd2fe268d687ecb3f2d 100644 (file)
--- a/lhnet.c
+++ b/lhnet.c
@@ -104,7 +104,7 @@ int LHNETADDRESS_FromString(lhnetaddress_t *address, const char *string, int def
        struct hostent *hostentry;
        const char *colon;
        char name[128];
-       if (!address || !string)
+       if (!address || !string || !*string)
                return 0;
        memset(address, 0, sizeof(*address));
        address->addresstype = LHNETADDRESSTYPE_NONE;
@@ -252,7 +252,7 @@ int LHNETADDRESS_ToString(const lhnetaddress_t *address, char *string, int strin
                {
                        if (stringbuffersize >= 6)
                        {
-                               strcpy(string, "local");
+                               memcpy(string, "local", 6);
                                return 1;
                        }
                }