summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>2013-06-04 14:59:05 +0000
committermichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>2013-06-04 14:59:05 +0000
commit925439c6d70e73d48e7a64c8417981c3c5d54e48 (patch)
tree00c41a081c303e7aa938bc87a513c4d7e1079b14 /src
parent6fc638ed61aad91989c9fa4fa1b15a86708aeb9f (diff)
- Fixes to changes done in -r2165
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@2195 82007160-df01-0410-b94d-b575c5fd34c7
Diffstat (limited to 'src')
-rw-r--r--src/motd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/motd.c b/src/motd.c
index 138b9b3..63b8f43 100644
--- a/src/motd.c
+++ b/src/motd.c
@@ -103,7 +103,7 @@ motd_cache(struct Motd *motd)
struct MotdCache *cache = NULL;
struct stat sb;
char line[MOTD_LINESIZE + 2]; /* \r\n */
- char *tmp = line;
+ char *tmp = NULL;
unsigned int i = 0;
dlink_node *ptr = NULL;
@@ -152,7 +152,7 @@ motd_cache(struct Motd *motd)
while (cache->count < cache->maxcount && fgets(line, sizeof(line), file))
{
/* copy over line, stopping when we overflow or hit line end */
- for (; i < (MOTD_LINESIZE - 1) && *tmp && *tmp != '\r' && *tmp != '\n'; ++tmp, ++i)
+ for (tmp = line, i = 0; i < (MOTD_LINESIZE - 1) && *tmp && *tmp != '\r' && *tmp != '\n'; ++tmp, ++i)
cache->motd[cache->count][i] = *tmp;
cache->motd[cache->count][i] = '\0';