--- embedtools/src/Attic/upd.c 2010/03/24 16:46:39 1.1.2.9 +++ embedtools/src/Attic/upd.c 2011/06/08 09:15:32 1.1.2.10 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ - * $Id: upd.c,v 1.1.2.9 2010/03/24 16:46:39 misho Exp $ + * $Id: upd.c,v 1.1.2.10 2011/06/08 09:15:32 misho Exp $ * *************************************************************************/ #include "global.h" @@ -473,7 +473,7 @@ int Daemonize(struct sockaddr_in sin, const char *csTF default: tftp->th_code = htons(ENOSPACE); } - sprintf(tftp->th_data, "Error:: in file %s", + snprintf(tftp->th_data, STRSIZ, "Error:: in file %s", strerror(errno)); sendto(s, buf, strlen(tftp->th_data) + 4, 0, (struct sockaddr*) &cli, sizeof cli); @@ -541,7 +541,8 @@ int Daemonize(struct sockaddr_in sin, const char *csTF memset(buf, 0, TFTP_BUF); tftp->th_opcode = htons(ERROR); tftp->th_code = htons(EBADID); - sprintf(tftp->th_data, "Error:: in transfer #%d", seq); + snprintf(tftp->th_data, STRSIZ, "Error:: in transfer #%d", + seq); sendto(s, buf, strlen(tftp->th_data) + 4, 0, (struct sockaddr*) &cli, sizeof cli); retry--; @@ -588,7 +589,7 @@ int Daemonize(struct sockaddr_in sin, const char *csTF default: tftp->th_code = htons(ENOSPACE); } - sprintf(tftp->th_data, "Error:: in file %s", + snprintf(tftp->th_data, STRSIZ, "Error:: in file %s", strerror(errno)); sendto(s, buf, strlen(tftp->th_data) + 4, 0, (struct sockaddr*) &cli, sizeof cli); @@ -653,7 +654,8 @@ int Daemonize(struct sockaddr_in sin, const char *csTF memset(buf, 0, TFTP_BUF); tftp->th_opcode = htons(ERROR); tftp->th_code = htons(EBADID); - sprintf(tftp->th_data, "Error:: in transfer #%d", seq); + snprintf(tftp->th_data, STRSIZ, "Error:: in transfer #%d", + seq); sendto(s, buf, strlen(tftp->th_data) + 4, 0, (struct sockaddr*) &cli, sizeof cli); retry--;