diff options
| author | 2006-10-06 10:03:22 +0000 | |
|---|---|---|
| committer | 2006-10-06 10:03:22 +0000 | |
| commit | a519f21f44dbbaf30b90fe44a9a73f930d61c185 (patch) | |
| tree | aea82af83a134fbf22592386b8d24f184439fe4b /src/configreader.cpp | |
| parent | Update to support modular prefixes, and eliminate some string copying (diff) | |
| download | inspircd++-a519f21f44dbbaf30b90fe44a9a73f930d61c185.tar.gz inspircd++-a519f21f44dbbaf30b90fe44a9a73f930d61c185.tar.bz2 inspircd++-a519f21f44dbbaf30b90fe44a9a73f930d61c185.zip | |
Remove a strcpy
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5433 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/configreader.cpp')
| -rw-r--r-- | src/configreader.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
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 : " "); } } |
