DWORD   len = strlen(noteText);;
DWORD   len = strlen(noteText);
StripSignedMessage(LPSTR noteText, DWORD totalCR) {char    *newBuf;LPSTR   startTag = "<HTML>";LPSTR   endTag = "/HTML>";DWORD   i;DWORD   realLen = 0;DWORD   startPos = 0;DWORD   len = strlen(noteText);;  // create a new buffer...  newBuf = (char *) malloc((size_t)(len + totalCR));  if (!newBuf)    return(noteText);  newBuf[0] = '\0';  // First, find the start of the HTML for the message...  for (i=0; i<len; i++)  {    // should we check for first tag    if ( (i+strlen(startTag)) < len)    {      if (strncmp(startTag, (noteText + i), strlen(startTag)) == 0)      {        startPos = i + strlen(startTag);        break;      }    }  }  // Didn't find any HTML start tag  if (i == len)    return(noteText);  BOOL    inHTML = FALSE;  BOOL    firstChar = FALSE;  for (i=startPos; i<len; i++)  {    char  *ptr = (noteText + i);    if ( ((*ptr == 0x0D) || (*ptr == 0x20)) && (!firstChar) )      continue;    else      firstChar = TRUE;    // First, check for the end /HTML> tag    if ( (i+strlen(endTag)) < len)    {      if (strncmp(endTag, ptr, strlen(endTag)) == 0)      {        break;      }    }    // If we are in HTML, check for a ">"...    if (inHTML)    {      if (*ptr == '>')      {        inHTML = FALSE;      }      continue;    }    // Check for NEW HTML...    if (*ptr == '<')    {      inHTML = TRUE;      continue;    }    if (CheckForInlineHTML(ptr, len, &i, newBuf, &realLen))      continue;    newBuf[realLen++] = *ptr;    // Tack on a line feed if we hit a CR...    if ( *ptr == 0x0D )    {      newBuf[realLen++] = 0x0A;    }  }  // terminate the buffer - reallocate and move on...  newBuf[realLen++] = '\0';  newBuf = (LPSTR) realloc(newBuf, (size_t) realLen);  // check if the realloc worked and if so, free old memory and  // return...if not, just return the original buffer  if (!newBuf)  {    return(noteText);  }  else  {    free(noteText);    return(newBuf);  }}