Commit 6ea98116 authored by Seblu's avatar Seblu
Browse files

Fix bug in config file reader

parent 7fe62539
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -124,8 +124,9 @@ SLDaemon::Options SLDaemon::getoptions(const string file) const {

  while (!fs.eof()) {
    fs.getline(line, MAX_CONF_LINE_SIZE);
//     if (fs.eof())
//       break;
    if (fs.eof())
      break;
    ++i;
    sscanf(line, "%10[^=]=%2039s\n", name, value); //TODO: fix magic number

    if (!strcasecmp(name, "host"))
@@ -143,7 +144,7 @@ SLDaemon::Options SLDaemon::getoptions(const string file) const {
    else if (!strcasecmp(name, "retrydelay"))
      o.retrydelay = atoi(value);
    else
      std::cerr << "Invalid line " << i << ": " << line;
      std::cerr << "Invalid line " << i << ": " << line << std::endl;
  }

  fs.close();