From b58e2c7c56b1416a343e81f9f80cb1f02c128e25 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 27 May 2016 18:10:39 +0200 Subject: prevent C++ locale number formatting in text APIs Setting the C++ locale via std::locale::global(std::locale("")); which would otherwise default to the default C locale (aka: unaffected by setlocale) effects the formatting of numeric types in IO streams, which for output for humans is perfectly sensible, but breaks our many text interfaces used and parsed by us and others without expecting the numbers to be formatted. Closes: #825396 --- cmdline/apt-helper.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-helper.cc b/cmdline/apt-helper.cc index b92055ab7..fd4d269c2 100644 --- a/cmdline/apt-helper.cc +++ b/cmdline/apt-helper.cc @@ -102,7 +102,7 @@ static bool DoSrvLookup(CommandLine &CmdL) /*{{{*/ _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; + ioprintf(c1out, "%s\t%d\t%d\t%d\n", I.target.c_str(), I.priority, I.weight, I.port); } return true; } -- cgit v1.2.3