aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/references.cc
diff options
context:
space:
mode:
authorThéophane Hufschmitt <theophane.hufschmitt@tweag.io>2023-06-15 21:24:14 +0200
committerThéophane Hufschmitt <theophane.hufschmitt@tweag.io>2023-06-15 21:24:14 +0200
commitb2247ef4f6b02cf4e666455eb9afc86398fff35d (patch)
treebc435a9b55757db20bb3e1cf0005203e2e3c8b7e /src/libutil/references.cc
parente672d52f7caae591e4d07747a312f2bef538bbea (diff)
Don't assume the type of string::size_type
The code accidentally conflated `std::string::size_type` and `long unsigned int`. This was fine on 64bits machines where they are apparently the same in practice, but not on 32bits. Fix that by using `std::string::size_type` everywhere.
Diffstat (limited to 'src/libutil/references.cc')
-rw-r--r--src/libutil/references.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libutil/references.cc b/src/libutil/references.cc
index 74003584a..7f59b4c09 100644
--- a/src/libutil/references.cc
+++ b/src/libutil/references.cc
@@ -75,7 +75,7 @@ RewritingSink::RewritingSink(const std::string & from, const std::string & to, S
RewritingSink::RewritingSink(const StringMap & rewrites, Sink & nextSink)
: rewrites(rewrites), nextSink(nextSink)
{
- long unsigned int maxRewriteSize = 0;
+ std::string::size_type maxRewriteSize = 0;
for (auto & [from, to] : rewrites) {
assert(from.size() == to.size());
maxRewriteSize = std::max(maxRewriteSize, from.size());