From 343602dcd90724fe30eb1d4a81bab534f3463f4e Mon Sep 17 00:00:00 2001
From: Mark Jenkinson <mark@fmrib.ox.ac.uk>
Date: Thu, 16 Nov 2000 09:39:00 +0000
Subject: [PATCH] changed substr call, as it actually requires (initial
 position, length) NOT (initial position, final position)

---
 options.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/options.cc b/options.cc
index a4f97f7..59d2fde 100644
--- a/options.cc
+++ b/options.cc
@@ -23,9 +23,9 @@ bool BaseOption::matches(const string& arg)
 {
   string::size_type pos = 0, np;
   while((np = key_.find(",", pos)) != string::npos) {
-    if(arg == key_.substr(pos, np))
+    if(arg == key_.substr(pos, np - pos))
       return true;
-    pos = np+1;
+    pos = np + 1;
   }
   if(arg == key_.substr(pos, string::npos))
     return true;
-- 
GitLab