Skip to content

Commit

Permalink
src: fix use of uninitialized variable
Browse files Browse the repository at this point in the history
Variable was uninitialized in 72547fe
Initialize the variable and add a static_check

PR-URL: #9281
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
  • Loading branch information
jasnell committed Oct 28, 2016
1 parent 758ca8d commit 2bd850b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/node_i18n.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2bd850b

Please sign in to comment.