X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fstrings%2Fformat.cpp;h=42926e158d593a8a5d84ffb88dfcdddce26a80d5;hb=HEAD;hp=773eefac7fc30698bab7c8d6ebfca8fb1188de18;hpb=c3e242c2629cbc9645258b30aaf07b7285d4372b;p=libs%2Fcore.git diff --git a/source/strings/format.cpp b/source/strings/format.cpp index 773eefa..42926e1 100644 --- a/source/strings/format.cpp +++ b/source/strings/format.cpp @@ -19,6 +19,9 @@ Formatter::Formatter(const Formatter &other): Formatter &Formatter::operator=(const Formatter &other) { + if(&other==this) + return *this; + fmt = other.fmt; pos = fmt.begin()+(other.pos-other.fmt.begin()); result = other.result; @@ -55,7 +58,7 @@ Fmt Formatter::get_conversion() if(pos==fmt.end()) throw format_error("Too many arguments for format"); - string::iterator i = pos; + auto i = pos; for(; i!=fmt.end(); ++i) if(isalpha(*i)) break;