ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/conf_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 1646 by michael, Wed Nov 7 21:02:43 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   }

Diff Legend

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