From a519f21f44dbbaf30b90fe44a9a73f930d61c185 Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 6 Oct 2006 10:03:22 +0000 Subject: Remove a strcpy git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5433 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/configreader.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src/configreader.cpp') diff --git a/src/configreader.cpp b/src/configreader.cpp index 30e966b94..2c7067127 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -1271,23 +1271,18 @@ bool ServerConfig::ReadFile(file_cache &F, const char* fname) char linebuf[MAXBUF]; F.clear(); - file = fopen(fname,"r"); + file = fopen(fname, "r"); if (file) { while (!feof(file)) { - fgets(linebuf,sizeof(linebuf),file); - linebuf[strlen(linebuf)-1]='\0'; - - if (!*linebuf) - { - strcpy(linebuf," "); - } + fgets(linebuf, sizeof(linebuf), file); + linebuf[strlen(linebuf)-1] = 0; if (!feof(file)) { - F.push_back(linebuf); + F.push_back(*linebuf ? linebuf : " "); } } -- cgit v1.3.1-10-gc9f91