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:
parent
3a4ec61d46
commit
5008f8de08
@ -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++);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user