Testing using setbuf() instead of flush