added basic ssl support to ircu
[ircu2.10.12-pk.git] / ircd / m_pass.c
index b1aef623d5db41aacc70cbf26b7f965e8187fb56..e34e6819aba9b17c7a183417cf5ab76632b2ee44 100644 (file)
@@ -112,9 +112,11 @@ int mr_pass(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     len += strlen(parv[arg]);
     password[len++] = ' ';
   }
-  password[--len] = '\0';
+  if (len > 0)
+    --len;
+  password[len] = '\0';
 
-  if (EmptyString(password))
+  if (password[0] == '\0')
     return need_more_params(cptr, "PASS");
 
   ircd_strncpy(cli_passwd(cptr), password, PASSWDLEN);