Browse Source

Move all defintions to the top of chansno_hook_tkladd

jesopo 3 years ago
parent
commit
2d2e8089e8
1 changed files with 9 additions and 7 deletions
  1. 9 7
      u4/m_chansno.c

+ 9 - 7
u4/m_chansno.c

@@ -571,20 +571,22 @@ static int chansno_override_oper(Cmdoverride *ovr, aClient *cptr, aClient *sptr,
 // Added by jesopo
 int chansno_hook_tkladd(aClient *cptr, aClient *sptr, aTKline *tkl, int parc, char *parv[]) {
 	char setby[NICKLEN + USERLEN + HOSTLEN + 6];
+	char *name;
+	aClient *setter;
+	char txt[256];
+	char set_at[256];
+	char expire_at[256];
+	char *timeret;
+
 	strncpy(setby, tkl->setby, sizeof(setby));
-	char *name = strtok(setby, "!");
+	name = strtok(setby, "!");
 
-	aClient *setter = find_client(name, NULL);
+	setter = find_client(name, NULL);
 	if(setter == NULL || (!IsMe(setter) && !MyClient(setter)))
 	{
 		 return HOOK_CONTINUE;
 	}
 
-	char txt[256];
-	char set_at[256];
-	char expire_at[256];
-	char *timeret;
-
 	switch (tkl->type)
 	{
 		case TKL_KILL: