Skip to content

Commit

Permalink
src,tools: drop nul byte from built-in source code
Browse files Browse the repository at this point in the history
PR-URL: #5418
Reviewed-By: Trevor Norris <[email protected]>
  • Loading branch information
bnoordhuis authored and rvagg committed Feb 27, 2016
1 parent 17d14f3 commit 03a5dab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/node_javascript.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ using v8::String;
Local<String> MainSource(Environment* env) {
return String::NewFromUtf8(
env->isolate(), reinterpret_cast<const char*>(node_native),
NewStringType::kNormal, sizeof(node_native) - 1).ToLocalChecked();
NewStringType::kNormal, sizeof(node_native)).ToLocalChecked();
}

void DefineJavaScript(Environment* env, Local<Object> target) {
Expand Down
4 changes: 2 additions & 2 deletions tools/js2c.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@


def ToCArray(filename, lines):
return ','.join(str(ord(c)) for c in lines + '\0')
return ','.join(str(ord(c)) for c in lines)


def CompressScript(lines, do_jsmin):
Expand Down Expand Up @@ -221,7 +221,7 @@ def ReadMacros(lines):


NATIVE_DECLARATION = """\
{ "%(id)s", %(escaped_id)s_native, sizeof(%(escaped_id)s_native)-1 },
{ "%(id)s", %(escaped_id)s_native, sizeof(%(escaped_id)s_native) },
"""

SOURCE_DECLARATION = """\
Expand Down

0 comments on commit 03a5dab

Please sign in to comment.