fuzz/x86_emulate: Clear errors in the officially sanctioned way
authorGeorge Dunlap <george.dunlap@citrix.com>
Wed, 11 Oct 2017 17:49:37 +0000 (18:49 +0100)
committerGeorge Dunlap <george.dunlap@citrix.com>
Wed, 11 Oct 2017 22:35:21 +0000 (23:35 +0100)
commitcf72cfb0c8513c3f83dc9541312b12e7325f5c02
tree12212a8807a4c8a05225196dc644893aad05ffb1
parenta02bb8da9397d4d949dd74dbe5a7d850becd5736
fuzz/x86_emulate: Clear errors in the officially sanctioned way

Commit 849a1f10c9 was checked in inappropriately; review flagged up
that clearerr() was too big a hammer, as it would clear both the EOF
flag and stream errors.

Stream errors shouldn't be cleared; we only want the EOF and other
stream-related state reset.  To do this, it is sufficient to fseek()
to zero.

Signed-off-by: George Dunlap <george.dunlap@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
tools/fuzz/x86_instruction_emulator/afl-harness.c