Skip to content

Commit a5d43d1

Browse files
committed
Fix undefined snprintf use for older compiler
The snprintf API is not available with older versions of MSVC. Found by a CI run.
1 parent 43ab5a8 commit a5d43d1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/addons-napi/test_buffer/test_buffer.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ void newBuffer(napi_env env, napi_callback_info info) {
4444
reinterpret_cast<void**>(&theCopy),
4545
&theBuffer));
4646
JS_ASSERT(env, theCopy, "Failed to copy static text for newBuffer");
47-
snprintf(theCopy, kBufferSize, "%s", theText);
47+
memcpy(theCopy, theText, kBufferSize);
4848
NAPI_CALL(env, napi_set_return_value(env, info, theBuffer));
4949
}
5050

0 commit comments

Comments
 (0)