Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Æsthetic improvements and two fixes #27

Merged
merged 10 commits into from
Dec 5, 2017
Merged

Conversation

Porges
Copy link
Contributor

@Porges Porges commented Dec 5, 2017

Fixes: #26, also returns once we hit an error in the loop instead of continuing.

(Mostly) stylistic changes:

  • Remove a few unneeded buffers and variables
  • sprintfsprintf_s
  • Simplify DWORD extraction code (this needs review – is it possible to store non-DWORD data in DWORD entries like you can shove anything into REG_SZ?)
  • Use nullptr
  • Junk TCHAR and its ilk

Needed:

  • Need to add a test for dodgy non-null-terminated data, but I'm not sure the best way to actually get this into the registry in the first place, since REG.EXE is going to do it correctly. Can we add adjunct C++ programs to the test code somehow?

@shiftkey
Copy link
Member

shiftkey commented Dec 5, 2017

Can we add adjunct C++ programs to the test code somehow?

If there's a test harness that's easy enough to setup and run from tasks in package.json (I'm happy to help write the shell scripts for this) then let's get this stuff in.

EDIT: moving this to #28

Copy link
Member

@shiftkey shiftkey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good. Just a tweak to the code comments in the other places where we're formatting errors.

src/main.cc Outdated
@@ -130,8 +129,9 @@ v8::Local<v8::Array> EnumerateValues(HKEY hCurrentKey, Isolate *isolate) {
else
{
char errorMessage[50]; // 39 for message + 10 for int + 1 for null

This comment was marked as spam.

src/main.cc Outdated
@@ -183,7 +183,7 @@ NAN_METHOD(ReadValues)
else
{
char errorMessage[46]; // 35 for message + 10 for int + 1 for null

This comment was marked as spam.

@shiftkey shiftkey dismissed their stale review December 5, 2017 07:37

making the changed myself

@shiftkey
Copy link
Member

shiftkey commented Dec 5, 2017

@shiftkey shiftkey merged commit 94ae686 into desktop:master Dec 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants