List:Commits« Previous MessageNext Message »
From:Magnus Blåudd Date:January 5 2011 3:28pm
Subject:Re: bzr commit into mysql-5.1-telco-7.0 branch (jonas:4058)
View as plain text  
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?
Thread
bzr commit into mysql-5.1-telco-7.0 branch (jonas:4058) jonas oreland14 Dec
  • Re: bzr commit into mysql-5.1-telco-7.0 branch (jonas:4058)Magnus Blåudd5 Jan
    • Re: bzr commit into mysql-5.1-telco-7.0 branch (jonas:4058)Tor Didriksen5 Jan
      • Re: bzr commit into mysql-5.1-telco-7.0 branch (jonas:4058)Tor Didriksen5 Jan
      • Re: bzr commit into mysql-5.1-telco-7.0 branch (jonas:4058)Magnus Blåudd11 Jan