diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2008-03-31 21:54:37 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2008-03-31 21:54:37 +0200 |
commit | 566e0d93cee4a5b0f6e28c72f0795d1e2af4690d (patch) | |
tree | 350bfb33c3ca0e809f6ec0eb704b959674896ef2 /net | |
parent | 51965dca8650e7b2c721b6eb77d5b9e02772df4d (diff) | |
download | barebox-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.c | 13 |
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; |