Fix core dump when server fails to respond.

Reviewed by:	imp
This commit is contained in:
Gavin Atkinson 2010-06-27 14:11:03 +00:00
parent bc96d3d17a
commit a1ec94b88d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=209550

View File

@ -229,7 +229,10 @@ recvfile(int peer, char *port, int fd, char *name, char *mode)
/* Otherwise it is a fatal error */
break;
}
if (i == 12) {
printf("Transfer timed out.\n");
return;
}
if (rp->th_opcode == ERROR) {
tftp_log(LOG_ERR, "Error code %d: %s", rp->th_code, rp->th_msg);
return;