Code:
memcpy(receive_str, input + 4, input.size);



Look at what I wrote! That was no mistake.
Please read up on pointer arithmetic as well.

Furthermore, the way you handle the STRING, is absolutely wrong! Use a cstring here, don't allocate memory for a STRING object, don't copy it around. You are doing it absolutely wrong in every possible way!

Edit: Nitpicking: Why do you declare a named struct when you never access it through the struct namespace anyways? Just use an anonymous struct for these things and avoid polluting the struct namespace.

Last edited by Wiseguy; 05/28/13 20:13.

His words are wise, his face is beard.