/[svn]/ircd-hybrid/branches/8.1.x/src/motd.c
ViewVC logotype

Diff of /ircd-hybrid/branches/8.1.x/src/motd.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2408 by michael, Sat Jun 22 20:53:35 2013 UTC revision 2409 by michael, Fri Jul 19 15:43:53 2013 UTC
# Line 143  motd_cache(struct Motd *motd) Line 143  motd_cache(struct Motd *motd)
143    }    }
144    
145    /* Ok, allocate a structure; we'll realloc later to trim memory */    /* Ok, allocate a structure; we'll realloc later to trim memory */
146    cache = MyMalloc(sizeof(struct MotdCache) + (MOTD_LINESIZE * (MOTD_MAXLINES - 1)));    cache = MyMalloc(sizeof(struct MotdCache) + (MOTD_LINESIZE * MOTD_MAXLINES));
147    cache->ref = 1;    cache->ref = 1;
148    cache->path = xstrdup(motd->path);    cache->path = xstrdup(motd->path);
149    cache->maxcount = motd->maxcount;    cache->maxcount = motd->maxcount;
# Line 163  motd_cache(struct Motd *motd) Line 163  motd_cache(struct Motd *motd)
163    
164    /* trim memory usage a little */    /* trim memory usage a little */
165    motd->cache = MyMalloc(sizeof(struct MotdCache) +    motd->cache = MyMalloc(sizeof(struct MotdCache) +
166                           (MOTD_LINESIZE * (cache->count - 1)));                           (MOTD_LINESIZE * cache->count));
167    memcpy(motd->cache, cache, sizeof(struct MotdCache) +    memcpy(motd->cache, cache, sizeof(struct MotdCache) +
168           (MOTD_LINESIZE * (cache->count - 1)));           (MOTD_LINESIZE * cache->count));
169    MyFree(cache);    MyFree(cache);
170    
171    /* now link it in... */    /* now link it in... */

Legend:
Removed from v.2408  
changed lines
  Added in v.2409

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.28