Porter algorithm??? You programming or eating steak?

Ok, let's see if I
digested what you said ...
I'm not exactly sure what your stem function's prototype is, so I'll try and guess it based on your description:
Guess #1:
void stem(char *before, char *wordStartPos, char *wordEndPos)
{
char localWord[100]; // Buffer to hold copy of word
int wordLen = (int)(wordEndPos - wordStartPos) + 1; // Calculate word length using pointer offset arithmetic
// Copy
wordLen # of characters from
before (pointed to by
wordStartPos) into
localWord
memcpy(localWord, wordStartPos, wordLen);
// NULL TERMINATE the new copy of the word
localWord[wordLen]='\0';
// Clear out the original word in
before (pointed to by
wordStartPos)
memset(wordStartPos, NULL, wordLen);
}
============================================================
Guess #2:
void stem(char *before, int wordStartPos, int wordEndPos)
{
char localWord[100]; // Buffer to hold copy of word
int wordLen = wordEndPos - wordStartPos + 1; // Calculate the word length
// Copy
wordLen # of characters from
before (at offset
wordStartPos) into
localWord
memcpy(localWord, before+wordStartPos, wordLen);
// NULL TERMINATE the new copy of the word
localWord[wordLen]='\0';
// Clear out the original word in
before (again, at offset
wordStartPos)
memset(before+wordStartPos, NULL, wordLen);
}
*EDIT* Obviously I was already working on this reply when you posted your reply that you figured out your problem. Maybe the above code will be useful to you anyway. <shrug>