trasher: check seek return value.

Fixes CID733726
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8ab0b9cabacad57cad7c26144baa544fab9c2ba7)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-10-13 19:46:53 +02:00
parent 35b15a0da8
commit 12801f969b

View File

@ -54,7 +54,10 @@ int main(int argc, char **argv)
while (count--) { while (count--) {
int burst = 1 + ran() * (uint64_t) (abs(maxburst) - 1) / UINT32_MAX; int burst = 1 + ran() * (uint64_t) (abs(maxburst) - 1) / UINT32_MAX;
int pos = ran() * (uint64_t) length / 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) if (maxburst < 0)
burst = -maxburst; burst = -maxburst;