Skip to content

Commit

Permalink
Fix undefined snprintf use for older compiler (nodejs#178)
Browse files Browse the repository at this point in the history
The snprintf API is not available with older versions of MSVC. Found by a CI run.
  • Loading branch information
jasongin authored Mar 21, 2017
1 parent e1e092f commit fb18a18
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/addons-napi/test_buffer/test_buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void newBuffer(napi_env env, napi_callback_info info) {
reinterpret_cast<void**>(&theCopy),
&theBuffer));
JS_ASSERT(env, theCopy, "Failed to copy static text for newBuffer");
snprintf(theCopy, kBufferSize, "%s", theText);
memcpy(theCopy, theText, kBufferSize);
NAPI_CALL(env, napi_set_return_value(env, info, theBuffer));
}

Expand Down

0 comments on commit fb18a18

Please sign in to comment.