Skip to content

Commit 96adbe9

Browse files
committed
src,tools: drop nul byte from built-in source code
PR-URL: #5418 Reviewed-By: Trevor Norris <[email protected]>
1 parent cdc7e02 commit 96adbe9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/node_javascript.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ using v8::String;
2020
Local<String> MainSource(Environment* env) {
2121
return String::NewFromUtf8(
2222
env->isolate(), reinterpret_cast<const char*>(node_native),
23-
NewStringType::kNormal, sizeof(node_native) - 1).ToLocalChecked();
23+
NewStringType::kNormal, sizeof(node_native)).ToLocalChecked();
2424
}
2525

2626
void DefineJavaScript(Environment* env, Local<Object> target) {

tools/js2c.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242

4343

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

4747

4848
def CompressScript(lines, do_jsmin):
@@ -221,7 +221,7 @@ def ReadMacros(lines):
221221

222222

223223
NATIVE_DECLARATION = """\
224-
{ "%(id)s", %(escaped_id)s_native, sizeof(%(escaped_id)s_native)-1 },
224+
{ "%(id)s", %(escaped_id)s_native, sizeof(%(escaped_id)s_native) },
225225
"""
226226

227227
SOURCE_DECLARATION = """\

0 commit comments

Comments
 (0)