Bug: Port numbers sometimes show up in logs with negative values
Danger: Trivial - Display only bug.
Found by: Remcon
Fixed by: Remcon
sprintf( log_buf, "Sock.sinaddr: %s, port %hd.", buf, dnew->port );
sprintf( log_buf, "Sock.sinaddr: %s, port %d.", buf, dnew->port );
This is a very subtle one to spot, but it makes all the difference when displaying the value. %hd is the formatting tag for a signed short, while %d is the formatting tag for an int. Since port numbers can go to 65535, a signed short isn't the proper size to display it.