fix valgrind issues in tests

This commit is contained in:
Arvid Norberg 2013-09-04 05:50:40 +00:00
parent 75789e3958
commit 0f3cb1b8a4
2 changed files with 2 additions and 0 deletions

View File

@ -224,6 +224,7 @@ TORRENT_EXPORT void assert_fail(char const* expr, int line, char const* file
#endif
char stack[8192];
stack[0] = '\0';
print_backtrace(stack, sizeof(stack), 0);
fprintf(out, "assertion failed. Please file a bugreport at "

View File

@ -252,6 +252,7 @@ int test_main()
std::vector<char> buf;
bencode(std::back_inserter(buf), torrent);
buf.push_back('\0');
printf("%s\n", &buf[0]);
error_code ec;
torrent_info ti(&buf[0], buf.size(), ec);