Browse Source

src: fix use of uninitialized variable

Variable was uninitialized in 72547fe28d
Initialize the variable and add a static_check

PR-URL: https://github.com/nodejs/node/pull/9281
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
v7.x
James M Snell 8 years ago
committed by Evan Lucas
parent
commit
5ab172ee8f
  1. 4
      src/node_i18n.cc

4
src/node_i18n.cc

@ -586,7 +586,9 @@ static void GetStringWidth(const FunctionCallbackInfo<Value>& args) {
TwoByteValue value(env->isolate(), args[0]);
// reinterpret_cast is required by windows to compile
UChar* str = reinterpret_cast<UChar*>(*value);
UChar32 c;
static_assert(sizeof(*str) == sizeof(**value),
"sizeof(*str) == sizeof(**value)");
UChar32 c = 0;
UChar32 p;
size_t n = 0;
uint32_t width = 0;

Loading…
Cancel
Save