summaryrefslogtreecommitdiffstats
path: root/netem
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2017-08-24 11:41:28 +0200
committerStephen Hemminger <stephen@networkplumber.org>2017-08-24 15:22:10 -0700
commit92963d136de8c370324716add98888b2ce6e6a94 (patch)
treefa1726c34fc9b703ce9279cbcfa856556aa58d73 /netem
parent0aa03350c00d70edbbdab0662a2d8262be2bb68d (diff)
netem/maketable: Check return value of fscanf()
Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'netem')
-rw-r--r--netem/maketable.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/netem/maketable.c b/netem/maketable.c
index ad660e7d..ccb8f0c6 100644
--- a/netem/maketable.c
+++ b/netem/maketable.c
@@ -38,8 +38,8 @@ readdoubles(FILE *fp, int *number)
}
for (i=0; i<limit; ++i){
- fscanf(fp, "%lf", &x[i]);
- if (feof(fp))
+ if (fscanf(fp, "%lf", &x[i]) != 1 ||
+ feof(fp))
break;
++n;
}