No idea why it reboots, but sizeof(buf) is 2 bytes only and should be replaced by 511. Typically reboots are caused by writing to memory location zero because of a NULL pointer. Harald