summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/configreader.cpp13
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 : " ");
}
}