Skip to content

Commit

Permalink
Fix chip-cert Crashes on Failure to Open File. (#15731)
Browse files Browse the repository at this point in the history
  • Loading branch information
emargolis authored and pull[bot] committed Jan 15, 2024
1 parent 504d993 commit 3270676
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tools/chip-cert/GeneralUtils.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2021 Project CHIP Authors
* Copyright (c) 2021-2022 Project CHIP Authors
* Copyright (c) 2013-2017 Nest Labs, Inc.
* All rights reserved.
*
Expand Down Expand Up @@ -199,7 +199,7 @@ bool OpenFile(const char * fileName, FILE *& file, bool toWrite)
file = fopen(fileName, toWrite ? "w+" : "r");
if (file == nullptr)
{
fprintf(stderr, "Unable to open %s: %s\n", fileName, strerror(ferror(file) ? errno : ENOSPC));
fprintf(stderr, "Unable to open %s: %s\n", fileName, strerror(errno));
ExitNow(res = false);
}
}
Expand Down

0 comments on commit 3270676

Please sign in to comment.