i'm receiving characters from a socket and loading them into a buffer, i'm trying to concatenate the buffer into another character array and its not working. can anyone help me?
if i change strcat(engine::exbuff, buffer) to something like strcat(engine::exbuff, "hello world") it will do as it should. to me this doesn't really seem logical. i know there are charcters in the array since if i call another function i can return the value of rc, and that is 4. can anyone tell me what is wrong?PHP Code:
char buffer[1024];
int rc = recv(engine::esock.sock, buffer, sizeof(buffer), 0);
if (rc != -1)
{
unsigned int value = unpack(buffer[0], buffer[1]);
buffer[rc + 1] = '\0';
switch (value)
{
case(0): // creation accept
strcat(engine::exbuff, buffer);
break;
}
return (static_cast<double>(value));
}