ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/resv.c
(Generate patch)

Comparing ircd-hybrid/trunk/src/resv.c (file contents):
Revision 1632 by michael, Sun Nov 4 15:37:10 2012 UTC vs.
Revision 1649 by michael, Sat Nov 10 19:27:13 2012 UTC

# Line 33 | Line 33
33   #include "hash.h"
34   #include "irc_string.h"
35   #include "ircd_defs.h"
36 + #include "s_misc.h"
37   #include "conf.h"
38   #include "conf_db.h"
39  
# Line 58 | Line 59 | create_channel_resv(char *name, char *re
59    if (hash_find_resv(name))
60      return NULL;
61  
61 –  if (strlen(reason) > REASONLEN)
62 –    reason[REASONLEN] = '\0';
63 –
62    conf = conf_make(CONF_CRESV);
63 <
64 <  DupString(conf->name, name);
67 <  DupString(conf->reason, reason);
63 >  conf->name = xstrdup(name);
64 >  conf->reason = xstrndup(reason, IRCD_MIN(strlen(reason), REASONLEN));
65  
66    dlinkAdd(conf, &conf->node, &resv_channel_list);
67    hash_add_resv(conf);
# Line 91 | Line 88 | create_nick_resv(char *name, char *reaso
88    if (find_matching_name_conf(CONF_NRESV, name, NULL, NULL, 0))
89      return NULL;
90  
94 –  if (strlen(reason) > REASONLEN)
95 –    reason[REASONLEN] = '\0';
96 –
91    conf = conf_make(CONF_NRESV);
92 <
93 <  DupString(conf->name, name);
100 <  DupString(conf->reason, reason);
92 >  conf->name = xstrdup(name);
93 >  conf->reason = xstrndup(reason, IRCD_MIN(strlen(reason), REASONLEN));
94  
95    return conf;
96   }
# Line 181 | Line 174 | report_resv(struct Client *source_p)
174      conf = ptr->data;
175      sendto_one(source_p, form_str(RPL_STATSQLINE),
176                 me.name, source_p->name,
177 <               conf->hold ? 'q' : 'Q',
177 >               conf->until ? 'q' : 'Q',
178                 conf->name, conf->reason);
179    }
180  
181    DLINK_FOREACH(ptr, nresv_items.head)
182    {
183 <    conf = ptr->data;;
183 >    conf = ptr->data;
184      sendto_one(source_p, form_str(RPL_STATSQLINE),
185                 me.name, source_p->name,
186 <               conf->hold ? 'q' : 'Q',
186 >               conf->until ? 'q' : 'Q',
187                 conf->name, conf->reason);
188    }
189   }

Diff Legend

– Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)