summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire.cc
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/acquire.cc')
-rw-r--r--apt-pkg/acquire.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc
index 29362fb40..1efb772b4 100644
--- a/apt-pkg/acquire.cc
+++ b/apt-pkg/acquire.cc
@@ -1258,8 +1258,11 @@ bool pkgAcquireStatus::Pulse(pkgAcquire *Owner)
snprintf(msg,sizeof(msg), _("Retrieving file %li of %li"), i, TotalItems);
// build the status str
- std::string dlstatus;
- strprintf(dlstatus, "dlstatus:%ld:%.4f:%s\n", i, Percent, msg);
+ std::ostringstream str;
+ str.imbue(std::locale("C.UTF-8"));
+ str.precision(4);
+ str << "dlstatus" << ':' << std::fixed << i << ':' << Percent << ':' << msg << '\n';
+ auto const dlstatus = str.str();
FileFd::Write(fd, dlstatus.data(), dlstatus.size());
}