Browse Source

trasher: check seek return value.

Fixes CID733726
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n1.1
Michael Niedermayer 13 years ago
parent
commit
8ab0b9caba
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      tools/trasher.c

+ 4
- 1
tools/trasher.c View File

@@ -56,7 +56,10 @@ int main(int argc, char **argv)
while (count--) {
int burst = 1 + ran() * (uint64_t) (abs(maxburst) - 1) / UINT32_MAX;
int pos = ran() * (uint64_t) length / UINT32_MAX;
fseek(f, pos, SEEK_SET);
if (fseek(f, pos, SEEK_SET) < 0) {
fprintf(stderr, "seek failed\n");
return 1;
}

if (maxburst < 0)
burst = -maxburst;


Loading…
Cancel
Save