From kde-commits Sat Nov 01 02:41:16 2003 From: Oswald Buddenhagen Date: Sat, 01 Nov 2003 02:41:16 +0000 To: kde-commits Subject: Re: kdelibs/kdecore X-MARC-Message: https://marc.info/?l=kde-commits&m=106765448306437 On Fri, Oct 31, 2003 at 11:43:35PM +0100, David Faure wrote: > On Friday 31 October 2003 23:05, Oswald Buddenhagen wrote: > > @@ -1785,5 +1785,5 @@ void KURL::setDirectory( const QString & > > void KURL::setQuery( const QString &_txt, int encoding_hint) > > { > > - if (_txt.length() && (_txt[0] =='?')) > > + if (_txt[0] == '?') > > _setQuery( _txt.mid(1), encoding_hint ); > > else > > Why? > Isn't this going to go out-of-bounds with an empty string in _txt? > qt/src/tools/qstring.h class QString { ... QChar at( uint i ) const { return i < d->len ? d->unicode[i] : QChar::null; } QChar operator[]( int i ) const { return at((uint)i); } ... }; in case of doubt, rtfm. :) greetings -- Hi! I'm a .signature virus! Copy me into your ~/.signature, please! -- Chaos, panic, and disorder - my work here is done.