I do use strncat for part of this... I have a function, tokenizeString, that is given the string, an unsigned character array, and the array of tokens. It returns the number of bytes that need to be appended to the output array, and then I use strncat to do just that:
numswaps = tokenizeString(line, tokline, tokens);
output = strncat(output, tokline, numswaps);
So, I should be using memmove (or memcpy?) instead here?