Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
lint
  • Loading branch information
nornagon authored Nov 5, 2019
commit e101c46b2d93034f22aa9744d0b9b09d486c40ea
5 changes: 4 additions & 1 deletion src/node_binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,10 @@ void DLOpen(const FunctionCallbackInfo<Value>& args) {
if (mp == nullptr || mp->nm_context_register_func == nullptr) {
dlib->Close();
char errmsg[1024];
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

could this be PATH_MAX?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

PATH_MAX + strlen("Module did not self-register.") + 1 i suppose?

given the code immediately below that also uses 1024 and includes *filename, I figured best to go for consistency :)

snprintf(errmsg, sizeof(errmsg), "Module did not self-register: '%s'.", *filename);
snprintf(errmsg,
sizeof(errmsg),
"Module did not self-register: '%s'.",
*filename);
env->ThrowError(errmsg);
return false;
}
Expand Down