Browse Source

Fix return value by Cfg::getIntOption.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/slim/trunk@209 7c53e7cc-98ea-0310-8f1f-a0b24da60408
iwamatsu 10 years ago
parent
commit
964fc643f5
2 changed files with 3 additions and 4 deletions
  1. 2 3
      cfg.cpp
  2. 1 1
      cfg.h

+ 2 - 3
cfg.cpp

@@ -229,9 +229,8 @@ int Cfg::string2int(const char* string, bool* ok) {
     return (*err == 0) ? l : 0;
 }
 
-int Cfg::getIntOption(std::string option, int defaultVal) {
-    int l = string2int(options[option].c_str());
-    return (l > 0) ? l : defaultVal;
+int Cfg::getIntOption(std::string option) {
+    return string2int(options[option].c_str());
 }
 
 // Get absolute position

+ 1 - 1
cfg.h

@@ -31,7 +31,7 @@ public:
     std::string parseOption(std::string line, std::string option);
     const std::string& getError() const;
     std::string& getOption(std::string option);
-    int getIntOption(std::string option, int defaultVal = 0);
+    int getIntOption(std::string option);
     std::string getWelcomeMessage();
 
     static int absolutepos(const std::string& position, int max, int width);