From f25e5b2856ec866b7ebb6cf4bf6802db3df84932 Mon Sep 17 00:00:00 2001 From: Richard Nyberg Date: Fri, 24 Jun 2005 10:25:40 +0000 Subject: [PATCH] sprintf -> snprintf Removed two unnecessary assignments. --- btpd/tracker_req.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/btpd/tracker_req.c b/btpd/tracker_req.c index aa56331..c8ef9e6 100644 --- a/btpd/tracker_req.c +++ b/btpd/tracker_req.c @@ -159,12 +159,10 @@ create_url(struct tracker_req *req, struct torrent *tp, char **url) qc = (strchr(tp->meta.announce, '?') == NULL) ? '?' : '&'; for (i = 0; i < 20; i++) - sprintf(e_hash + i * 3, "%%%.2x", tp->meta.info_hash[i]); - e_hash[61] = '\0'; + snprintf(e_hash + i * 3, 4, "%%%.2x", tp->meta.info_hash[i]); for (i = 0; i < 20; i++) - sprintf(e_id + i * 3, "%%%.2x", btpd.peer_id[i]); - e_id[61] = '\0'; + snprintf(e_id + i * 3, 4, "%%%.2x", btpd.peer_id[i]); left = torrent_bytes_left(tp);