summaryrefslogtreecommitdiff
path: root/cmdline/apt-helper.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2015-09-12 10:35:49 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2015-09-14 15:22:19 +0200
commit7414af7fa88164209eec9c585b8d175c1618ecbc (patch)
tree2a582637043bd8c57d43bf8b193dd9ecb479d559 /cmdline/apt-helper.cc
parent7c4f1ca5fe315a8223570b05994d6d7ca7c55c4f (diff)
various changes to increase test-coverage
And of course, testing obscure things ends up showing obscure 'bugs' or better shortcomings/inconsitencies, so lets fix them with the tests. Git-Dch: Ignore
Diffstat (limited to 'cmdline/apt-helper.cc')
-rw-r--r--cmdline/apt-helper.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmdline/apt-helper.cc b/cmdline/apt-helper.cc
index 2d24a8aee..dc4efb32b 100644
--- a/cmdline/apt-helper.cc
+++ b/cmdline/apt-helper.cc
@@ -81,7 +81,7 @@ static bool DoDownloadFile(CommandLine &CmdL)
static bool DoSrvLookup(CommandLine &CmdL)
{
- if (CmdL.FileSize() < 1)
+ if (CmdL.FileSize() <= 1)
return _error->Error("Must specify at least one SRV record");
for(size_t i = 1; CmdL.FileList[i] != NULL; ++i)
@@ -95,10 +95,10 @@ static bool DoSrvLookup(CommandLine &CmdL)
std::string const host = name.substr(0, found);
size_t const port = atoi(name.c_str() + found + 1);
if(GetSrvRecords(host, port, srv_records) == false)
- _error->Warning(_("GetSrvRec failed for %s"), name.c_str());
+ _error->Error(_("GetSrvRec failed for %s"), name.c_str());
}
else if(GetSrvRecords(name, srv_records) == false)
- _error->Warning(_("GetSrvRec failed for %s"), name.c_str());
+ _error->Error(_("GetSrvRec failed for %s"), name.c_str());
for (SrvRec const &I : srv_records)
c1out << I.target << "\t" << I.priority << "\t" << I.weight << "\t" << I.port << std::endl;