add: if (NumberOfBytes <= 0) return 0;
context: static size_t TokenizerPassGetPlainWords (  char *BufferPntr,  size_t NumberOfBytes,  char PrefixCharacter,  set<string> &WordSet){  string  AccumulatedWord;  char   *EndOfStringPntr;  size_t  Length;  int     Letter;  if (PrefixCharacter != 0)    AccumulatedWord = PrefixCharacter;  EndOfStringPntr = BufferPntr + NumberOfBytes;  while (true)  {    if (BufferPntr >= EndOfStringPntr)      Letter = EOF; // Usually a negative number.    else      Letter = (unsigned char) *BufferPntr++;    /* See if it is a letter we treat as white space.  Some word separators    like dashes and periods aren't considered as space.  Note that codes above    127 are UTF-8 characters, which we consider non-space. */    if (Letter < 0 /* EOF is -1 */ ||    (Letter < 128 && g_SpaceCharacters[Letter]))    {      /* That space finished off a word.  Remove trailing periods... */      while ((Length = AccumulatedWord.size()) > 0 &&      AccumulatedWord [Length-1] == '.')        AccumulatedWord.resize (Length - 1);      /* If there's anything left in the word, add it to the set.  Also ignore      words which are too big (it's probably some binary encoded data).  But      leave room for supercalifragilisticexpialidoceous.  According to one web      site, pneumonoultramicroscopicsilicovolcanoconiosis is the longest word      currently in English.  Note that some uuencoded data was seen with a 60      character line length. */      if (PrefixCharacter != 0)        Length--; // Don't count prefix when judging size or emptiness.      if (Length > 0 && Length <= g_MaxWordLength)        WordSet.insert (AccumulatedWord);      /* Empty out the string to get ready for the next word.  Not quite empty,      start it off with the prefix character if any. */      if (PrefixCharacter != 0)        AccumulatedWord = PrefixCharacter;      else        AccumulatedWord.resize (0);    }    else /* Not a space-like character, add it to the word. */      AccumulatedWord.append (1 /* one copy of the char */, (char) Letter);    if (Letter < 0)      break; /* End of data.  Exit here so that last word got processed. */  }  return NumberOfBytes;}