From fdcdce3bfecd8f7ea577bfa1d1dc7f04e9cf7d45 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 21 Feb 2025 17:14:24 +0000 Subject: apt-ftparchive: Do not output locale dependent dsc file size Removal of std::to_string avoids the temporary std::string, but it leads to locale-dependent output that parsers (including ours) are not prepared to encounter especially as number formatting can be highly ambiguous due to different rules surrounding '.' and ','. In the distant future (c++20) this could be replaced with a variant of std::format, which incidentally is also what std::to_string becomes an alias for in an even more distant future (c++26). Regression-of: 729a5c8f4fb8c841497d26170e1a47c41617ecd9 Reported-By: Stefan Lippers-Hollmann and Kel Modderman on IRC --- ftparchive/writer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ftparchive') diff --git a/ftparchive/writer.cc b/ftparchive/writer.cc index a0319caf4..d59781f29 100644 --- a/ftparchive/writer.cc +++ b/ftparchive/writer.cc @@ -616,7 +616,7 @@ static std::string getDscHash(unsigned int const DoHashes, if ((DoHashes & DoIt) != DoIt || not Tags.Exists(FieldKey) || Hash == nullptr) return ""; std::ostringstream out; - out << "\n " << Hash->HashValue() << " " << Size << " " << FileName + out << "\n " << Hash->HashValue() << " " << std::to_string(Size) << " " << FileName << "\n " << Tags.Find(FieldKey); return out.str(); } -- cgit v1.2.3-70-g09d2