msvc format string fixes

This commit is contained in:
Arvid Norberg 2009-09-06 16:47:48 +00:00
parent d0cb5049f7
commit 209b135956
2 changed files with 3 additions and 3 deletions

View File

@ -1361,7 +1361,7 @@ int main(int argc, char* argv[])
out += str; out += str;
snprintf(str, sizeof(str), "==== waste: %s fail: %s unchoked: %d / %d " snprintf(str, sizeof(str), "==== waste: %s fail: %s unchoked: %d / %d "
"bw queues: %8d (%d) | %8d (%d) cache: w: %"PRId64"%% r: %lld%% size: %s (%s) / %s dq: %"PRId64" ===\n" "bw queues: %8d (%d) | %8d (%d) cache: w: %"PRId64"%% r: %"PRId64"%% size: %s (%s) / %s dq: %"PRId64" ===\n"
, add_suffix(sess_stat.total_redundant_bytes).c_str() , add_suffix(sess_stat.total_redundant_bytes).c_str()
, add_suffix(sess_stat.total_failed_bytes).c_str() , add_suffix(sess_stat.total_failed_bytes).c_str()
, sess_stat.num_unchoked, sess_stat.allowed_upload_slots , sess_stat.num_unchoked, sess_stat.allowed_upload_slots

View File

@ -136,8 +136,8 @@ namespace libtorrent
if (tracker_req().kind == tracker_request::announce_request) if (tracker_req().kind == tracker_request::announce_request)
{ {
char str[1024]; char str[1024];
snprintf(str, sizeof(str), "&peer_id=%s&port=%d&uploaded=%lld" snprintf(str, sizeof(str), "&peer_id=%s&port=%d&uploaded=%"PRId64
"&downloaded=%lld&left=%lld&compact=1&numwant=%d&key=%x&no_peer_id=1" "&downloaded=%"PRId64"&left=%"PRId64"&compact=1&numwant=%d&key=%x&no_peer_id=1"
, escape_string((const char*)&tracker_req().pid[0], 20).c_str() , escape_string((const char*)&tracker_req().pid[0], 20).c_str()
// the i2p tracker seems to verify that the port is not 0, // the i2p tracker seems to verify that the port is not 0,
// even though it ignores it otherwise // even though it ignores it otherwise