-
recvfrom() overflow?
Using the following code in Dev-C++ makes the program quit, when the received message is >sizeof(buffer):
Code:
char buffer[32];
struct sockaddr_in from;
int recv,fromlen=sizeof(from);
recv=recvfrom(sd,buffer,sizeof(buffer),0,(struct sockaddr*)&from,&fromlen);
What could the problem be?
-
I'm sorry, ignore this. recv returned an error, while the documentation I read said the string would be truncated, so I assumed it would return bytes read. Just the result of lack of sleep. :P