Hello,

I get an out_of_range exception everytime I use a logger which name is
longer than the name of the root logger and wonder if anyone else ran
into this problem, too. We use a pretty old Borland Builder 5, may it
be an implementation issue of the stl? Reading how
basic_string::compare works for other implementations the current
startWith should work, in my opinion.

http://www.sgi.com/tech/stl/basic_string.html

I had to make the following changes:

Index: stringhelper.cpp
===================================================================
--- stringhelper.cpp    (Revision 1652)
+++ stringhelper.cpp    (Arbeitskopie)
@@ -79,6 +79,11 @@
 
 bool StringHelper::startsWith(const LogString& s, const LogString& prefix)
 {
+    if (s.length() < prefix.length())
+    {
+      return false;
+    }
+
     return s.compare(0, prefix.length(), prefix) == 0;
 }

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning
AM-SoFT IT-Systeme - Hameln | Potsdam | Leipzig
 
Telefon: Potsdam: 0331-743881-0
E-Mail:  tschoen...@am-soft.de
Web:     http://www.am-soft.de

AM-SoFT GmbH IT-Systeme, Konsumhof 1-5, 14482 Potsdam
Amtsgericht Potsdam HRB 21278 P, Geschäftsführer: Andreas Muchow

Reply via email to