From 925439c6d70e73d48e7a64c8417981c3c5d54e48 Mon Sep 17 00:00:00 2001 From: michael Date: Tue, 4 Jun 2013 14:59:05 +0000 Subject: - 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 --- src/motd.c | 4 ++-- 1 file 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'; -- cgit