} else if (aSourceBuffer[i] == '\'') { *ptr++ = '&'; *ptr++ = 'l'; *ptr++ = 's'; *ptr++ = 'q'; *ptr++ = 'u'; *ptr++ = 'o'; *ptr++ = ';';
nsEscapeHTML2(const PRUnichar *aSourceBuffer, PRInt32 aSourceBufferLen){  // if the caller didn't calculate the length  if (aSourceBufferLen == -1) {    aSourceBufferLen = nsCRT::strlen(aSourceBuffer); // ...then I will  }  PRUnichar *resultBuffer = (PRUnichar *)nsMemory::Alloc(aSourceBufferLen*6*sizeof(PRUnichar) + sizeof(PRUnichar('\0')));  PRUnichar *ptr = resultBuffer;  if (resultBuffer) {    PRInt32 i;    for(i = 0; i < aSourceBufferLen; i++) {      if(aSourceBuffer[i] == '<') {        *ptr++ = '&';        *ptr++ = 'l';        *ptr++ = 't';        *ptr++ = ';';      } else if(aSourceBuffer[i] == '>') {        *ptr++ = '&';        *ptr++ = 'g';        *ptr++ = 't';        *ptr++ = ';';      } else if(aSourceBuffer[i] == '&') {        *ptr++ = '&';        *ptr++ = 'a';        *ptr++ = 'm';        *ptr++ = 'p';        *ptr++ = ';';      } else if (aSourceBuffer[i] == '"') {        *ptr++ = '&';        *ptr++ = 'q';        *ptr++ = 'u';        *ptr++ = 'o';        *ptr++ = 't';        *ptr++ = ';';      } else {        *ptr++ = aSourceBuffer[i];      }    }    *ptr = 0;  }  return resultBuffer;}