0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00
This commit is contained in:
dwight 2010-12-13 20:45:16 -05:00
parent 6691b05e5b
commit 8f98101ecb

View File

@ -31,15 +31,10 @@ namespace mongo {
// if profiling indicates this method is a significant bottleneck, we could have a version we
// use for reads which does not fill with zeroes, and keep the zeroing behavior on writes.
//
int i = 0;
while( ns[i] ) {
buf[i] = ns[i];
if( ++i >= MaxNsLen-1 )
uasserted( 10080 , "ns name too long, max size is 128" );
}
do {
buf[i++] = 0;
} while( i < MaxNsLen );
unsigned len = strlen(ns);
uassert( 10080 , "ns name too long, max size is 128", len < MaxNsLen);
memset(buf, 0, MaxNsLen);
memcpy(buf, ns, len);
return *this;
}