Browse Source

sprintf -> snprintf

Removed two unnecessary assignments.
master
Richard Nyberg 19 years ago
parent
commit
f25e5b2856
1 changed files with 2 additions and 4 deletions
  1. +2
    -4
      btpd/tracker_req.c

+ 2
- 4
btpd/tracker_req.c View File

@@ -159,12 +159,10 @@ create_url(struct tracker_req *req, struct torrent *tp, char **url)
qc = (strchr(tp->meta.announce, '?') == NULL) ? '?' : '&'; qc = (strchr(tp->meta.announce, '?') == NULL) ? '?' : '&';


for (i = 0; i < 20; i++) 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++) 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); left = torrent_bytes_left(tp);




Loading…
Cancel
Save