mirror of
https://github.com/NixOS/nix
synced 2025-07-06 09:11:47 +02:00
Remove all the occurences of VLAs
There's generally no strict reason for using them, and they are somewhat fishy, so let's avoid them.
This commit is contained in:
parent
5196613e82
commit
ba3cb4a049
3 changed files with 14 additions and 17 deletions
|
@ -151,11 +151,10 @@ StorePath writeDerivation(Store & store,
|
|||
/* Read string `s' from stream `str'. */
|
||||
static void expect(std::istream & str, std::string_view s)
|
||||
{
|
||||
char s2[s.size()];
|
||||
str.read(s2, s.size());
|
||||
std::string_view s2View { s2, s.size() };
|
||||
if (s2View != s)
|
||||
throw FormatError("expected string '%s', got '%s'", s, s2View);
|
||||
for (auto & c : s) {
|
||||
if (str.get() != c)
|
||||
throw FormatError("expected string '%1%'", s);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue