Remove stream buffering in c code