Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
linux: fix fscanf() -Wunused-result warning
  • Loading branch information
bnoordhuis committed Aug 22, 2012
1 parent 03bdfd0 commit 29eb460
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/unix/linux/linux-core.c
Expand Up @@ -469,8 +469,9 @@ static unsigned long read_cpufreq(unsigned int cpunum) {
if (fp == NULL)
return 0;

val = 0;
fscanf(fp, "%lu", &val);
if (fscanf(fp, "%lu", &val) != 1)
val = 0;

fclose(fp);

return val;
Expand Down

0 comments on commit 29eb460

Please sign in to comment.