diff --git a/src/linux/apply.cpp b/src/linux/apply.cpp index ee2e64b..5514302 100644 --- a/src/linux/apply.cpp +++ b/src/linux/apply.cpp @@ -1441,8 +1441,8 @@ Status Plan::apply_range(Phase first, Phase last, ApplyFds& fds) const { if (nf > 0) { buf[nf] = '\0'; std::uint64_t ino = 0; - for (const char* p = buf; *p; ++p) - if (*p >= '0' && *p <= '9') ino = ino * 10 + std::uint64_t(*p - '0'); + for (const char* d = buf; *d; ++d) + if (*d >= '0' && *d <= '9') ino = ino * 10 + std::uint64_t(*d - '0'); fds.proxy_netns_ino = ino; } } diff --git a/src/windows/compile.cpp b/src/windows/compile.cpp index 8367b1c..536fdb4 100644 --- a/src/windows/compile.cpp +++ b/src/windows/compile.cpp @@ -203,30 +203,30 @@ Result compile(const Policy& policy, const HostCapabilities& h // past the policy-vocabulary roots: native forms only, with the // drive prefix already stripped above. anything else starting with // "/" failed the root table and never reaches here. - std::string out; - out.reserve(s.size()); + std::string native; + native.reserve(s.size()); bool prev_sep = false; for (const char c : s) { if (c == '/' || c == '\\') { - if (!prev_sep && !out.empty()) out.push_back('\\'); + if (!prev_sep && !native.empty()) native.push_back('\\'); prev_sep = true; } else { - out.push_back(c); + native.push_back(c); prev_sep = false; } } - while (!out.empty() && out.back() == '\\') out.pop_back(); - if (out.empty()) + while (!native.empty() && native.back() == '\\') native.pop_back(); + if (native.empty()) return std::unexpected(Error{Errc::invalid_policy, "path normalizes to nothing"}); - const bool drive = out.size() >= 2 && out[1] == ':' && - ((out[0] >= 'A' && out[0] <= 'Z') || - (out[0] >= 'a' && out[0] <= 'z')); - const bool unc = out.size() >= 2 && out[0] == '\\' && out[1] == '\\'; + const bool drive = native.size() >= 2 && native[1] == ':' && + ((native[0] >= 'A' && native[0] <= 'Z') || + (native[0] >= 'a' && native[0] <= 'z')); + const bool unc = native.size() >= 2 && native[0] == '\\' && native[1] == '\\'; if (!drive && !unc) return std::unexpected(Error{Errc::invalid_policy, "path has no drive prefix (need C:\\... or \\\\server\\\\share)"}); - return out; + return native; }; for (const auto& g : effective.grants()) {