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]) && !(*ptr)->flags & H_NO_EXPIRE)
+ if ((time(NULL) - (*ptr)->last_activity > HELPMOD_ACCOUNT_EXPIRATION[(*ptr)->level]) && !((*ptr)->flags & H_NO_EXPIRE))
haccount_del(*ptr);
else
ptr = &(*ptr)->next;