Since callback() takes both a pointer an a length I'm guessing the contents of 'payload' is not null-terminated.
Try using strncpy() with the supplied length. You may have to explicitly add the terminator.
Since callback() takes both a pointer an a length I'm guessing the contents of 'payload' is not null-terminated.
Try using strncpy() with the supplied length. You may have to explicitly add the terminator.