Fix buffer read limits (fixes issue #3140839 - http://sourceforge.net/tracker/?func=detail&aid=3140839&group_id=98171&atid=620206)
Fix buffer read limits (fixes issue #3140839 - http://sourceforge.net/tracker/?func=detail&aid=3140839&group_id=98171&atid=620206)

tgbyte/expectj,tgbyte/expectj