cygwin: fix return of uninitialized variable

pull/22966/head
Ben Noordhuis 2011-09-25 03:31:39 +02:00
parent d157131439
commit 6ee676c0e4
1 changed files with 2 additions and 0 deletions

View File

@ -340,6 +340,8 @@ double Platform::GetUptimeImpl() {
char line[512];
FILE *fpUptime = fopen("/proc/uptime", "r");
amount = 0;
if (fpUptime) {
if (fgets(line, 511, fpUptime) != NULL) {
sscanf(line, "%lf %*lf", &amount);