Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2020-01-21 22:30:35 +0300
committerAnna Henningsen <anna@addaleax.net>2020-01-24 00:39:00 +0300
commit32e7e813e93ec3d0625d315658288769e448dd99 (patch)
tree9479d9ed447e6a75b158a43a558e3aadb2b1db63 /src/node_process_methods.cc
parent9cc747bfcea131797fbf0fcc805f1d7fa244b7da (diff)
src: use custom fprintf alike to write errors to stderr
This allows printing errors that contain nul characters, for example. Fixes: https://github.com/nodejs/node/issues/28761 Fixes: https://github.com/nodejs/node/issues/31218 PR-URL: https://github.com/nodejs/node/pull/31446 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'src/node_process_methods.cc')
-rw-r--r--src/node_process_methods.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/node_process_methods.cc b/src/node_process_methods.cc
index 7efe8efb9b9..7b91f89e791 100644
--- a/src/node_process_methods.cc
+++ b/src/node_process_methods.cc
@@ -1,4 +1,5 @@
#include "base_object-inl.h"
+#include "debug_utils-inl.h"
#include "env-inl.h"
#include "node.h"
#include "node_errors.h"
@@ -216,7 +217,7 @@ void RawDebug(const FunctionCallbackInfo<Value>& args) {
CHECK(args.Length() == 1 && args[0]->IsString() &&
"must be called with a single string");
Utf8Value message(args.GetIsolate(), args[0]);
- PrintErrorString("%s\n", *message);
+ FPrintF(stderr, "%s\n", message);
fflush(stderr);
}