From 9c12e53d47cad78bfb79f5c61bf1cb4134aa6fb7 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Thu, 9 Jul 2020 20:28:21 +0200 Subject: [PATCH] src: remove redundant snprintf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/34282 Reviewed-By: Richard Lau Reviewed-By: Luigi Pinca Reviewed-By: Anto Aravinth Reviewed-By: Tobias Nießen Reviewed-By: James M Snell --- src/node_dir.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/node_dir.cc b/src/node_dir.cc index 7d1e1b1d7d6609..ac5739b99325c5 100644 --- a/src/node_dir.cc +++ b/src/node_dir.cc @@ -108,9 +108,7 @@ inline void DirHandle::GCClose() { if (ret < 0) { // Do not unref this env()->SetImmediate([detail](Environment* env) { - char msg[70]; - snprintf(msg, arraysize(msg), - "Closing directory handle on garbage collection failed"); + const char* msg = "Closing directory handle on garbage collection failed"; // This exception will end up being fatal for the process because // it is being thrown from within the SetImmediate handler and // there is no JS stack to bubble it to. In other words, tearing