Skip to content

Commit

Permalink
fix: add curly braces around if/for even for one statement (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
loverdos authored Aug 29, 2023
2 parents 67aebd2 + db0e5b6 commit 9cf1cf5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
Binary file modified prebuilds/darwin-arm64/node.napi.node
Binary file not shown.
Binary file modified prebuilds/darwin-x64/node.napi.node
Binary file not shown.
Binary file modified prebuilds/linux-x64/node.napi.node
Binary file not shown.
12 changes: 8 additions & 4 deletions src/keyring.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ Napi::Array listOsStore(const Napi::CallbackInfo& info) {
char **goResult = ListOsStore(serviceName);
int i, resultSize;

for (int i = resultSize = 0; strcmp(goResult[i], "") != 0; i++)
for (int i = resultSize = 0; strcmp(goResult[i], "") != 0; i++) {
resultSize += 1;
}

Napi::Array result = Napi::Array::New(env, resultSize);

Expand All @@ -86,8 +87,9 @@ Napi::Array listOsStore(const Napi::CallbackInfo& info) {
}

delete [] serviceName;
for (i = 0; i <= resultSize; i++)
for (i = 0; i <= resultSize; i++) {
free(goResult[i]);
}
free(goResult);

return result;
Expand Down Expand Up @@ -210,8 +212,9 @@ Napi::Array listFileStore(const Napi::CallbackInfo& info) {
char **goResult = ListFileStore(fileSaveDir);
int i, resultSize;

for (int i = resultSize = 0; strcmp(goResult[i], "") != 0; i++)
for (int i = resultSize = 0; strcmp(goResult[i], "") != 0; i++) {
resultSize += 1;
}

Napi::Array result = Napi::Array::New(env, resultSize);

Expand All @@ -221,8 +224,9 @@ Napi::Array listFileStore(const Napi::CallbackInfo& info) {
}

delete [] fileSaveDir;
for (int i = 0; i <= resultSize; i++)
for (int i = 0; i <= resultSize; i++) {
free(goResult[i]);
}
free (goResult);

return result;
Expand Down

0 comments on commit 9cf1cf5

Please sign in to comment.