mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-09 11:42:33 +00:00
Fix resource leaks and minor issues
- Close pipe fds on fork failure in ExecFile::execute - Add exception-safe fclose in cmd_file_append via try/catch - Add overflow guards before K/M/G bit shifts in parse_whole_value - Fix %u format for int* in sscanf (change to %d) - Fix typo "atter"→"after" in error message
This commit is contained in:
@@ -137,7 +137,7 @@ void
|
||||
OptionParser::call_int_pair(slot_int_pair slot, const std::string& arg) {
|
||||
int a, b;
|
||||
|
||||
if (std::sscanf(arg.c_str(), "%u-%u", &a, &b) != 2)
|
||||
if (std::sscanf(arg.c_str(), "%d-%d", &a, &b) != 2)
|
||||
throw std::runtime_error("Invalid argument, \"" + arg + "\" should be \"a-b\"");
|
||||
|
||||
slot(a, b);
|
||||
|
||||
Reference in New Issue
Block a user