PRUnichar* nsCRT::strndup(const PRUnichar* str, PRUint32 len) { nsCppSharedAllocator<PRUnichar> shared_allocator; PRUnichar* rslt = shared_allocator.allocate(len + 1);   if (rslt == NULL) return NULL; nsCRT::memcpy(rslt, str, len * sizeof(PRUnichar)); rslt[len] = 0; return rslt; }
static char* strndup(const char* str, PRUint32 len) { return PL_strndup(str, len); }
PRUnichar* nsCRT::strndup(const PRUnichar* str, PRUint32 len){	nsCppSharedAllocator<PRUnichar> shared_allocator;	PRUnichar* rslt = shared_allocator.allocate(len + 1); // add one for the null  // PRUnichar* rslt = new PRUnichar[len + 1];  if (rslt == NULL) return NULL;  nsCRT::memcpy(rslt, str, len * sizeof(PRUnichar));  rslt[len] = 0;  return rslt;}