-/* ModeNode.c - NeonServ v5.2
- * Copyright (C) 2011 Philipp Kreil (pk910)
+/* ModeNode.c - NeonServ v5.6
+ * Copyright (C) 2011-2012 Philipp Kreil (pk910)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#include "ChanUser.h"
#include "UserNode.h"
#include "BanNode.h"
+#include "log.h"
static int modes_with_strarg, modes_with_intarg, modes_count;
struct ModeNode *modes = malloc(sizeof(*modes));
if (!modes)
{
- perror("malloc() failed");
+ printf_log("main", LOG_ERROR, "%s:%d malloc() failed", __FILE__, __LINE__);
return NULL;
}
modes->chan = chan;
modes->modes &= ~modeOpt[0];
modes->allmodes |= modeOpt[0];
if(MODE_TYPE == CHANNEL_MODE_TYPE_B) {
- if(!param) return 0;
+ if(!param && !(modeOpt[2] & CHANNEL_MODE_KEY)) return 0;
if(MODE_VALUE == CHANNEL_MODE_VALUE_STRING) {
free(modes->mode_str_args[MODE_VALUE_INDEX]);
modes->mode_str_args[MODE_VALUE_INDEX] = NULL;