logo       

Sponsor
FREE Network Mapping Tool for Microsoft® Office Visio® Professional 2007
Don't map your network by hand - let LANsurveyor Exx press for Microsoft Visio Professional 2007 automatically create network diagrams for you!

RE: Corrected bug in StringHelper::endsWith on CVS HEAD: msg#00024

apache.logging.log4cxx.user

Subject: RE: Corrected bug in StringHelper::endsWith on CVS HEAD

If suffix.length() is bigger than s.length() you'll get std::out_of_range exception, because s.length() - suffix.length() will yield a *very* big value.
(but I haven't looked at the source code to see whether the arguments are being checked by the caller, so sorry for my comment, if that's the case)
 
Cheers,
Stoyan
-----Original Message-----
From: Bjцrn Carlsson [mailto:maillist@xxxxxxxxxxxxxxxxxx]
Sent: 03/09/2005 12:00
To: log4cxx-user@xxxxxxxxxxxxxxxxxx
Subject: Corrected bug in StringHelper::endsWith on CVS HEAD

Both
    bool StringHelper::endsWith(const std::string& s, const std::string& suffix)
and
    bool StringHelper::endsWith(const std::wstring& s, const std::wstring& suffix)
should be like this:
      return s.compare(s.length() - suffix.length(), suffix.length(), suffix) == 0;

and not
      return suffix.compare(s.length() - suffix.length(), suffix.length(), s) == 0;

--
/Björn Carlsson
VersionSupport.com

<Prev in Thread] Current Thread [Next in Thread>
Sponsor
FREE Network Mapping Tool for Microsoft® OfficeVisio Professional 2007
Don't map your network by hand - let LANsurveyor Express for Microsoft Visio Professional 2007
automatically create network diagrams for you!
Google Custom Search

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation

Home | sitemap | advertise | OSDir is an inevitable website. super tiny logo