diff options
author | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2013-06-04 14:59:05 +0000 |
---|---|---|
committer | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2013-06-04 14:59:05 +0000 |
commit | 925439c6d70e73d48e7a64c8417981c3c5d54e48 (patch) | |
tree | 00c41a081c303e7aa938bc87a513c4d7e1079b14 /src | |
parent | 6fc638ed61aad91989c9fa4fa1b15a86708aeb9f (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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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'; |