haccount *haccount_add(const char *name, hlevel lvl)
{
- haccount *tmp = (haccount*)malloc(sizeof (haccount));
+ haccount *tmp;
if (haccount_get_by_name(name))
{
if (*name == '#')
name++;
+ tmp = (haccount*)malloc(sizeof (haccount));
tmp->name = getsstring(name, strlen(name));
tmp->level = lvl;
tmp->flags = H_ACCFLAGS_DEFAULT;
{
haccount **ptr = &haccounts;
while (*ptr)
- if (time(NULL) - (*ptr)->last_activity > HELPMOD_ACCOUNT_EXPIRATION[(*ptr)->level])
- haccount_del(*ptr);
- else
+ if ((time(NULL) - (*ptr)->last_activity > HELPMOD_ACCOUNT_EXPIRATION[(*ptr)->level]) && !((*ptr)->flags & H_NO_EXPIRE))
+ haccount_del(*ptr);
+ else
ptr = &(*ptr)->next;
}
const char *haccount_get_state(haccount* hacc, int mask)
{
if (hacc->flags & mask)
- return "On";
+ return "Yes";
else
- return "Off";
+ return "No";
}
int haccount_count(hlevel lvl)
case 5:
return "Suppress unknown command error";
default:
- return "error. Please contact strutsi";
+ return "Error. Please contact strutsi";
}
}