Skip to content

Commit

Permalink
Move variable to function
Browse files Browse the repository at this point in the history
  • Loading branch information
jlatusek committed Jul 19, 2024
1 parent eaf191d commit 3fbfd62
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/tools/spake2p/Cmd_GenVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,8 @@ uint8_t gSalt[BASE64_MAX_DECODED_LEN(BASE64_ENCODED_LEN(kSpake2p_Max_PBKDF_Salt_
uint8_t gSaltDecodedLen = 0;
uint8_t gSaltLen = 0;
const char * gOutFileName = nullptr;
std::ifstream gPinCodeFile;

static uint32_t GetNextPinCode()
static uint32_t GetNextPinCode(std::ifstream & gPinCodeFile)
{
if (!gPinCodeFile.is_open())
{
Expand Down Expand Up @@ -207,13 +206,14 @@ bool HandleOption(const char * progName, OptionSet * optSet, int id, const char
break;

case 'f':
std::ifstream gPinCodeFile;
gPinCodeFile.open(arg, std::ios::in);
if (gPinCodeFile.fail())
{
PrintArgError("%s: Failed to open the PIN code file: %s\n", progName, arg);
return false;
}
gPinCode = GetNextPinCode();
gPinCode = GetNextPinCode(gPinCodeFile);
gPinCodeFile.close();
break;

Expand Down

0 comments on commit 3fbfd62

Please sign in to comment.