On 12/14/2010 01:53 PM, jonas oreland wrote:
> === modified file 'storage/ndb/src/common/util/BaseString.cpp'
> --- a/storage/ndb/src/common/util/BaseString.cpp 2010-11-28 11:34:01 +0000
> +++ b/storage/ndb/src/common/util/BaseString.cpp 2010-12-14 12:53:32 +0000
> @@ -54,6 +54,26 @@ BaseString::BaseString(const char* s)
> m_len = n;
> }
>
> +BaseString::BaseString(const char * s, size_t n)
> +{
> + if (s == NULL || n == 0)
> + {
> + m_chr = NULL;
> + m_len = 0;
> + return;
> + }
> + m_chr = new char[n + 1];
> + if (m_chr == NULL)
> + {
> + errno = ENOMEM;
> + m_len = 0;
> + return;
> + }
Is it really such a good idea to touch errno, don't you think "new" will
set it when it fails?