forked from premiere/premiere-libtorrent
Fix some more unlikely integer truncation
This commit is contained in:
parent
a647fd475e
commit
0eee042bf9
|
@ -465,7 +465,7 @@ namespace {
|
|||
{
|
||||
// pad files don't need a path element, we'll just store them
|
||||
// under the .pad directory
|
||||
char cnt[10];
|
||||
char cnt[11];
|
||||
std::snprintf(cnt, sizeof(cnt), "%d", pad_file_cnt);
|
||||
path = combine_path(".pad", cnt);
|
||||
++pad_file_cnt;
|
||||
|
|
|
@ -2387,7 +2387,7 @@ TORRENT_TEST(immutable_put)
|
|||
TEST_ERROR(t.error_string);
|
||||
continue;
|
||||
}
|
||||
char tok[10];
|
||||
char tok[11];
|
||||
std::snprintf(tok, sizeof(tok), "%02d", idx);
|
||||
|
||||
msg_args args;
|
||||
|
@ -2418,7 +2418,7 @@ TORRENT_TEST(immutable_put)
|
|||
TEST_EQUAL(put_immutable_item_keys[2].string_value(), "put");
|
||||
span<const char> const v = put_immutable_item_keys[6].data_section();
|
||||
TEST_EQUAL(v, span<char const>(flat_data));
|
||||
char tok[10];
|
||||
char tok[11];
|
||||
std::snprintf(tok, sizeof(tok), "%02d", idx);
|
||||
TEST_EQUAL(put_immutable_item_keys[5].string_value(), tok);
|
||||
if (put_immutable_item_keys[0].string_value() != "q"
|
||||
|
@ -2492,7 +2492,7 @@ TORRENT_TEST(mutable_put)
|
|||
TEST_ERROR(t.error_string);
|
||||
continue;
|
||||
}
|
||||
char tok[10];
|
||||
char tok[11];
|
||||
std::snprintf(tok, sizeof(tok), "%02d", idx);
|
||||
|
||||
msg_args args;
|
||||
|
@ -2528,7 +2528,7 @@ TORRENT_TEST(mutable_put)
|
|||
, std::string(sig.bytes.data(), signature::len));
|
||||
span<const char> const v = put_mutable_item_keys[10].data_section();
|
||||
TEST_CHECK(v == itemv);
|
||||
char tok[10];
|
||||
char tok[11];
|
||||
std::snprintf(tok, sizeof(tok), "%02d", idx);
|
||||
TEST_EQUAL(put_mutable_item_keys[9].string_value(), tok);
|
||||
if (put_mutable_item_keys[0].string_value() != "q"
|
||||
|
|
Loading…
Reference in New Issue