diff options
author | Phil Sutter <phil@nwl.cc> | 2017-08-24 11:41:28 +0200 |
---|---|---|
committer | Stephen Hemminger <stephen@networkplumber.org> | 2017-08-24 15:22:10 -0700 |
commit | 92963d136de8c370324716add98888b2ce6e6a94 (patch) | |
tree | fa1726c34fc9b703ce9279cbcfa856556aa58d73 | |
parent | 0aa03350c00d70edbbdab0662a2d8262be2bb68d (diff) |
netem/maketable: Check return value of fscanf()
Signed-off-by: Phil Sutter <phil@nwl.cc>
-rw-r--r-- | netem/maketable.c | 4 |
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; } |