mirror of
https://github.com/NixOS/nix.git
synced 2025-11-13 14:02:42 +01:00
git/getStringUntil: fix uninitialized stack variable
at least clang-tidy is not convinced that this initialized.
If this is not the case, the impact should be small and hopefully also
more robust if changed.
(cherry picked from commit 7e540059a3)
This commit is contained in:
parent
0178975340
commit
ab7a1df6ed
1 changed files with 1 additions and 1 deletions
|
|
@ -33,7 +33,7 @@ std::optional<Mode> decodeMode(RawMode m) {
|
|||
static std::string getStringUntil(Source & source, char byte)
|
||||
{
|
||||
std::string s;
|
||||
char n[1];
|
||||
char n[1] = { 0 };
|
||||
source(std::string_view { n, 1 });
|
||||
while (*n != byte) {
|
||||
s += *n;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue