linux: silence uninitialized variable warning

When building using gyp and BUILDTYPE=Release using clang 3.4 received
this warning:

../src/unix/linux-core.c:640:34: warning: variable 'n' is uninitialized
      for (len = sizeof("cpu0"); n /= 10; len++);
                                 ^

Initializing n = 0 silences this build warning.
This commit is contained in:
Trevor Norris 2014-01-22 11:52:51 -08:00 committed by Bert Belder
parent 3a4ec61d46
commit 5008f8de08

View File

@ -635,7 +635,7 @@ static int read_times(unsigned int numcpus, uv_cpu_info_t* ci) {
/* skip "cpu<num> " marker */
{
unsigned int n;
unsigned int n = 0;
assert(sscanf(buf, "cpu%u ", &n) == 1);
for (len = sizeof("cpu0"); n /= 10; len++);
}