]> jfr.im git - irc/rqf/shadowircd.git/commitdiff
m_pass.c fixed
authorValery Yatsko <redacted>
Wed, 2 Apr 2008 15:45:22 +0000 (19:45 +0400)
committerValery Yatsko <redacted>
Wed, 2 Apr 2008 15:45:22 +0000 (19:45 +0400)
include/irc_string.h
modules/m_pass.c

index 2aa7f41d076e32b7da8e4c4421ea796ac0804fa8..ba1d0a51f5988703390b91eceaf8a061ebf6a043 100644 (file)
@@ -99,12 +99,6 @@ size_t strlcpy(char *dst, const char *src, size_t siz);
 size_t strlcat(char *dst, const char *src, size_t siz);
 #endif
 
 size_t strlcat(char *dst, const char *src, size_t siz);
 #endif
 
-#ifdef HAVE_STRNDUP
-#define DupNString(x, y, len) do { x = strndup(y, len); if(x == NULL) outofmemory(); } while (0)
-#else
-#define DupNString(x, y, len) do { x = malloc(len+1); if(x == NULL) outofmemory(); strlcpy(x, y, len+1); } while(0)
-#endif
-
 /*
  * clean_string - cleanup control and high ascii characters
  * -Dianora
 /*
  * clean_string - cleanup control and high ascii characters
  * -Dianora
index 3f178e49a161ba6d6d328aff7f7000a6e2774cea..6ef11a8e59ce311fd916df0fbbb0c628e3686c26 100644 (file)
@@ -67,7 +67,7 @@ mr_pass(struct Client *client_p, struct Client *source_p, int parc, const char *
                rb_free(client_p->localClient->passwd);
        }
 
                rb_free(client_p->localClient->passwd);
        }
 
-       DupNString(client_p->localClient->passwd, parv[1], PASSWDLEN);
+       client_p->localClient->passwd = rb_strndup(parv[1], PASSWDLEN);
 
        /* These are for servers only */
        if(parc > 2 && client_p->user == NULL)
 
        /* These are for servers only */
        if(parc > 2 && client_p->user == NULL)