Closed GoogleCodeExporter closed 9 years ago
Unfortunatelly the problem is a bit deeper.
Accordind to 21.3.6.8/5 the function shall return this-
>compare(basic_string<charT,traits,Allocator>(s));
Because a constructor call is actually ommited, the comparision may be done
against
a C string with embedded '\0's.
Original comment by ntl.supp...@gmail.com
on 16 Dec 2007 at 1:47
Original comment by icestudent@gmail.com
on 16 Dec 2007 at 7:36
The bugfix shall be all right. traits_type::compare uses strncmp which is aware
of
embedded '\0' so temporary basic_string constructor is emulated correctly.
Expected
behavior should be as defined by the Standard.
However the problem I've mentioned above is really deeper in NTL and may affect
this
function clients.
For example one may retrieve std::wstring (with '\0' at the and) from a
registry key
value and use operator==. It will give -1 with "reg_sz\0" and "reg_sz".
Original comment by ntl.supp...@gmail.com
on 17 Jan 2008 at 4:24
Original comment by icestudent@gmail.com
on 10 Sep 2008 at 7:04
Original issue reported on code.google.com by
icestudent@gmail.com
on 15 Dec 2007 at 6:15