From d14f6d44eb6308f1739a137346ba577f8663a224 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Wed, 24 Feb 2016 21:59:25 +0100 Subject: [PATCH] src,tools: drop nul byte from built-in source code PR-URL: https://github.com/nodejs/node/pull/5418 Reviewed-By: Trevor Norris --- src/node_javascript.cc | 2 +- tools/js2c.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/node_javascript.cc b/src/node_javascript.cc index 6159cfede93810..5ba6e1d0a276f3 100644 --- a/src/node_javascript.cc +++ b/src/node_javascript.cc @@ -20,7 +20,7 @@ using v8::String; Local MainSource(Environment* env) { return String::NewFromUtf8( env->isolate(), reinterpret_cast(node_native), - NewStringType::kNormal, sizeof(node_native) - 1).ToLocalChecked(); + NewStringType::kNormal, sizeof(node_native)).ToLocalChecked(); } void DefineJavaScript(Environment* env, Local target) { diff --git a/tools/js2c.py b/tools/js2c.py index 9c5878a66818eb..761e80be59f76e 100755 --- a/tools/js2c.py +++ b/tools/js2c.py @@ -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): @@ -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 = """\