buffer: move buffer offset on truncation
buffer: move buffer offset on truncation

If the buffer offset was beyond the new EOF, move the offset to EOF.

Signed-off-by: Josef 'Jeff' Sipek <a620f141433c70aa9e43778305a6c68cbfadfb25@josefsipek.net>

jeffpc/libjeffpc,jeffpc/libjeffpc,jeffpc/libjeffpc,jeffpc/libjeffpc