Simple buffer chunking for networking applications in C