Don't use feof() - it doesn't work the way you expect it works.



#include <stdio.h>
#include <stdlib.h>

int main (int argc, char *argv[])
{
char buffer[256];