summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2008-03-31 21:54:37 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2008-03-31 21:54:37 +0200
commit566e0d93cee4a5b0f6e28c72f0795d1e2af4690d (patch)
tree350bfb33c3ca0e809f6ec0eb704b959674896ef2 /net
parent51965dca8650e7b2c721b6eb77d5b9e02772df4d (diff)
downloadbarebox-566e0d93cee4a5b0f6e28c72f0795d1e2af4690d.tar.gz
barebox-566e0d93cee4a5b0f6e28c72f0795d1e2af4690d.tar.xz
tftp.c: use sprintf instead of several strcpy functions
Diffstat (limited to 'net')
-rw-r--r--net/tftp.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/net/tftp.c b/net/tftp.c
index c0b29df3bb..bff32c153e 100644
--- a/net/tftp.c
+++ b/net/tftp.c
@@ -103,17 +103,8 @@ TftpSend (void)
s = (ushort *)pkt;
*s++ = htons(TFTP_RRQ);
pkt = (uchar *)s;
- strcpy ((char *)pkt, tftp_filename);
- pkt += strlen(tftp_filename) + 1;
- strcpy ((char *)pkt, "octet");
- pkt += 5 /*strlen("octet")*/ + 1;
- strcpy ((char *)pkt, "timeout");
- pkt += 7 /*strlen("timeout")*/ + 1;
- sprintf((char *)pkt, "%d", TIMEOUT);
-#ifdef ET_DEBUG
- printf("send option \"timeout %s\"\n", (char *)pkt);
-#endif
- pkt += strlen((char *)pkt) + 1;
+ pkt += sprintf((uchar *)pkt, "%s%coctet%ctimeout%c%d",
+ tftp_filename, 0, 0, 0, TIMEOUT) + 1;
len = pkt - xp;
break;