bufseek: Changed specification and improved range checking.