Finding the index of a symbol in unsigned char and extracting contents?

johnwasser:
Since callback() takes both a pointer an a length I'm guessing the contents of 'payload' is not null-terminated.

OP, From Reply #1:

gfvalvo:
Is it a properly NULL terminated 'C' string?