Skip to content

Commit c45623a

Browse files
tniessentargos
authored andcommitted
src: avoid unnecessarily formatting a warning
ProcessEmitWarning will already format the message, there is no need to call snprintf here. PR-URL: #21832 Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 0f70017 commit c45623a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/node_file.cc

+3-5
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,11 @@ inline void FileHandle::Close() {
172172
// to notify that the file descriptor was gc'd. We want to be noisy about
173173
// this because not explicitly closing the FileHandle is a bug.
174174
env()->SetUnrefImmediate([](Environment* env, void* data) {
175-
char msg[70];
176175
err_detail* detail = static_cast<err_detail*>(data);
177-
snprintf(msg, arraysize(msg),
178-
"Closing file descriptor %d on garbage collection",
179-
detail->fd);
176+
ProcessEmitWarning(env,
177+
"Closing file descriptor %d on garbage collection",
178+
detail->fd);
180179
delete detail;
181-
ProcessEmitWarning(env, msg);
182180
}, detail);
183181
}
184182

0 commit comments

Comments
 (0)