I'm reading a packet but I need to strip the first four bytes and the last byte from the packet to get what I need, how would you go about doing this in C?
/* Build an input buffer of the incoming message. */
while ( (len=read(clntSocket, line, MAXBUF)) != 0)
{
msg = (char *)malloc(len + 1);
memset(msg, 0, len+1);
strncpy(msg, line, len);
}
}
The incoming data is a mix of char and int data.